Skip to content

Add specific crash message for OOMs#7273

Open
seadowg wants to merge 11 commits into
getodk:masterfrom
seadowg:oom-crash
Open

Add specific crash message for OOMs#7273
seadowg wants to merge 11 commits into
getodk:masterfrom
seadowg:oom-crash

Conversation

@seadowg

@seadowg seadowg commented Jun 22, 2026

Copy link
Copy Markdown
Member

Closes #6859

Why is this the best possible solution? Were any other approaches considered?

As discussed in the issue, this doesn't actually fix the crash, but does add a new specific crash message when the app crashes due to an OutOfMemoryError. This won't catch every out of memory problem (as it can result in a range of side effect exceptions), but it should improve the error flow for a lot fo them.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Nothing to test here - good for a reviewer to try and validate this by hacking an OOM into the app.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg marked this pull request as ready for review June 22, 2026 14:04
@seadowg seadowg requested a review from grzesiek2010 June 22, 2026 14:04
Comment thread crash-handler/src/main/java/org/odk/collect/crashhandler/CrashHandler.kt Outdated
Comment thread crash-handler/src/main/java/org/odk/collect/crashhandler/CrashHandler.kt Outdated
Comment thread strings/src/main/res/values/strings.xml
Comment thread crash-handler/src/main/java/org/odk/collect/crashhandler/CrashHandler.kt Outdated
}
}

null -> null

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If decode fails, getCrash returns null while hasCrashed() stays true, so KEY_CRASH is never cleared and the app bounces to the crash screen on every launch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I've convert hasCrashed to an extension (that just uses the getCrash value) to prevent that.

@seadowg seadowg requested a review from grzesiek2010 June 23, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

100k entities in an update form

2 participants