Skip to content

Commit 3f0eb72

Browse files
authored
Merge pull request #2248 from bugsnag/release/v6.17.0
Release v6.17.0
2 parents 113b516 + c9c1aa4 commit 3f0eb72

40 files changed

Lines changed: 839 additions & 481 deletions

File tree

.buildkite/pipeline.full.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,6 @@ steps:
10131013
image-repository: 855461928731.dkr.ecr.us-west-1.amazonaws.com/android
10141014
cache-from:
10151015
- android-common:855461928731.dkr.ecr.us-west-1.amazonaws.com/android:latest
1016-
- docker-compose#v4.7.0:
10171016
push:
10181017
- android-common:855461928731.dkr.ecr.us-west-1.amazonaws.com/android:latest
10191018

.buildkite/pipeline.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ steps:
5252
env:
5353
JAVA_VERSION: 17
5454
command: './gradlew --continue checkstyle detekt lint ktlintCheck'
55-
env:
56-
JAVA_VERSION: 17
5755

5856
- label: ':android: Binary compatibility checks'
5957
timeout_in_minutes: 20
@@ -62,8 +60,6 @@ steps:
6260
env:
6361
JAVA_VERSION: 17
6462
command: './gradlew apiCheck'
65-
env:
66-
JAVA_VERSION: 17
6763

6864
- label: ':android: CppCheck'
6965
timeout_in_minutes: 10
@@ -100,8 +96,6 @@ steps:
10096
env:
10197
JAVA_VERSION: 17
10298
command: './gradlew test'
103-
env:
104-
JAVA_VERSION: 17
10599

106100
- label: ':android: Instrumentation tests'
107101
timeout_in_minutes: 10

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
steps:
4646
- name: Checkout repository
47-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
47+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
4848
with:
4949
submodules: recursive
5050
- uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 #v3.5.0
@@ -64,7 +64,7 @@ jobs:
6464

6565
# Initializes the CodeQL tools for scanning.
6666
- name: Initialize CodeQL
67-
uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 #v3.29.4
67+
uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed #v3.29.8
6868
with:
6969
languages: ${{ matrix.language }}
7070
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -83,6 +83,6 @@ jobs:
8383
./gradlew --no-daemon assemble
8484
8585
- name: Perform CodeQL Analysis
86-
uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 #v3.29.4
86+
uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed #v3.29.8
8787
with:
8888
category: "/language:${{matrix.language}}"

.github/workflows/downstream_updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ jobs:
2828
- run: >
2929
curl -X POST https://api.github.com/repos/${{ matrix.downstream_repo }}/dispatches
3030
-H 'Content-Type: application/json'
31-
-H "Authorization: Bearer ${{ secrets.DEP_UPDATER_BEARER_TOKEN }}"
31+
-H "Authorization: Token ${{ secrets.DEP_UPDATER_BEARER_TOKEN }}"
3232
-d '{"event_type":"update-dependency","client_payload": {"target_submodule":"bugsnag-android", "target_version": "${{ env.RELEASE_VERSION }}"}}'

.github/workflows/scorecard.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3636
with:
3737
persist-credentials: false
3838

@@ -68,13 +68,13 @@ jobs:
6868
# Upload the results to GitHub's code scanning dashboard (optional).
6969
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
71+
uses: github/codeql-action/upload-sarif@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
7272
with:
7373
sarif_file: results.sarif
7474

7575
gradle-wrapper-validation:
7676
name: "Checksum validation of Gradle Wrappers"
7777
runs-on: ubuntu-latest
7878
steps:
79-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80-
- uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
79+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
80+
- uses: gradle/actions/wrapper-validation@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 6.17.0 (2025-08-14)
4+
5+
### Enhancements
6+
7+
* `memoryTrimLevel` and `lowMemory` will not be reported when they are not set (newer versions of Android do not set these values)
8+
[#2237](https://github.com/bugsnag/bugsnag-android/pull/2237)
9+
10+
### Bug fixes
11+
12+
* Handle edge-cases to reduce the changes of duplicate ANR reporting from `bugsnag-plugin-android-exitinfo` when `reportUnmatchedANR = true && disableProcessStateSummaryOverride = true`
13+
[#2235](https://github.com/bugsnag/bugsnag-android/pull/2235)
14+
* Correct the reporting of the loadAddress for native system libraries and JIT frames
15+
[#2244](https://github.com/bugsnag/bugsnag-android/pull/2244)
16+
* Added deterministic sorting for `discardOldestFileIfNeeded` method to avoid potential crashes where mutliple files have the same last modified time
17+
[#2189](https://github.com/bugsnag/bugsnag-android/pull/2189)
18+
319
## 6.16.0 (2025-07-31)
420

521
### Changes

bugsnag-android-core/src/androidTest/java/com/bugsnag/android/ClientTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,12 @@ public void testAppDataCollection() {
171171
public void testAppDataMetadata() {
172172
client = generateClient();
173173
Map<String, Object> app = client.getAppDataCollector().getAppDataMetadata();
174-
assertEquals(11, app.size());
174+
assertEquals(9, app.size());
175175
assertEquals("Bugsnag Android Tests", app.get("name"));
176176
assertEquals("com.bugsnag.android.core.test", app.get("processName"));
177177
assertNotNull(app.get("memoryUsage"));
178178
assertTrue(app.containsKey("activeScreen"));
179179
assertTrue(app.containsKey("installerPackage"));
180-
assertNotNull(app.get("lowMemory"));
181-
assertNotNull(app.get("memoryTrimLevel"));
182180
}
183181

184182
@Test

bugsnag-android-core/src/main/java/com/bugsnag/android/AppDataCollector.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,15 @@ internal class AppDataCollector(
109109
val map = HashMap<String, Any?>()
110110
map["name"] = appName
111111
map["activeScreen"] = sessionTracker.get().contextActivity
112-
map["lowMemory"] = memoryTrimState.isLowMemory
113-
map["memoryTrimLevel"] = memoryTrimState.trimLevelDescription
114112
map["processImportance"] = getProcessImportance()
115113

114+
// only report the memory trim/low memory state if it has been captured
115+
// more recent Android versions will not report these
116+
if (memoryTrimState.memoryTrimLevel != null) {
117+
map["lowMemory"] = memoryTrimState.isLowMemory
118+
map["memoryTrimLevel"] = memoryTrimState.trimLevelDescription
119+
}
120+
116121
populateRuntimeMemoryMetadata(map)
117122

118123
bgWorkRestricted?.let {

bugsnag-android-core/src/main/java/com/bugsnag/android/FileStore.kt

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,32 @@ internal abstract class FileStore(
112112

113113
fun discardOldestFileIfNeeded() {
114114
// Limit number of saved payloads to prevent disk space issues
115-
if (isStorageDirValid(storageDir)) {
116-
val listFiles = storageDir.listFiles() ?: return
117-
if (listFiles.size < maxStoreCount) return
118-
val sortedListFiles = listFiles.sortedBy { it.lastModified() }
119-
// Number of files to discard takes into account that a new file may need to be written
120-
val numberToDiscard = listFiles.size - maxStoreCount + 1
121-
var discardedCount = 0
122-
for (file in sortedListFiles) {
123-
if (discardedCount == numberToDiscard) {
124-
return
125-
} else if (!queuedFiles.contains(file)) {
126-
logger.w(
127-
"Discarding oldest error as stored error limit reached: '" +
128-
file.path + '\''
129-
)
130-
deleteStoredFiles(setOf(file))
131-
discardedCount++
132-
}
115+
if (!isStorageDirValid(storageDir)) return
116+
val listFiles = storageDir.listFiles() ?: return
117+
if (listFiles.size < maxStoreCount) return
118+
119+
// Store lastModified to ensure it doesn't change during sort
120+
val timestampedFiles = listFiles.mapTo(ArrayList(listFiles.size)) { file ->
121+
FileWithTimestamp(file, file.lastModified())
122+
}
123+
124+
// Sort by cached lastModified timestamps
125+
timestampedFiles.sort()
126+
127+
// Number of files to discard takes into account that a new file may need to be written
128+
val numberToDiscard = listFiles.size - maxStoreCount + 1
129+
var discardedCount = 0
130+
131+
for (fileMeta in timestampedFiles) {
132+
val file = fileMeta.file
133+
if (discardedCount == numberToDiscard) {
134+
return
135+
} else if (!queuedFiles.contains(file)) {
136+
logger.w(
137+
"Discarding oldest error as stored error limit reached: '${file.path}'"
138+
)
139+
deleteStoredFiles(setOf(file))
140+
discardedCount++
133141
}
134142
}
135143
}
@@ -188,4 +196,18 @@ internal abstract class FileStore(
188196
lock.unlock()
189197
}
190198
}
199+
200+
/**
201+
* A data holder for associating a {@link File} with its last modified timestamp.
202+
*
203+
* @param file The file to associate with a timestamp.
204+
* @param timestamp The last modified time of the file, cached to ensure consistent ordering.
205+
*/
206+
private data class FileWithTimestamp(
207+
val file: File,
208+
val timestamp: Long
209+
) : Comparable<FileWithTimestamp> {
210+
override fun compareTo(other: FileWithTimestamp): Int =
211+
timestamp.compareTo(other.timestamp)
212+
}
191213
}

bugsnag-android-core/src/main/java/com/bugsnag/android/Notifier.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import java.io.IOException
77
*/
88
class Notifier @JvmOverloads constructor(
99
var name: String = "Android Bugsnag Notifier",
10-
var version: String = "6.16.0",
10+
var version: String = "6.17.0",
1111
var url: String = "https://bugsnag.com"
1212
) : JsonStream.Streamable {
1313

0 commit comments

Comments
 (0)