fix(ExportDialogFragment.kt) : TransactionTooLargeException #20984
Open
Alok-Silswal wants to merge 1 commit intoankidroid:mainfrom
Open
fix(ExportDialogFragment.kt) : TransactionTooLargeException #20984Alok-Silswal wants to merge 1 commit intoankidroid:mainfrom
Alok-Silswal wants to merge 1 commit intoankidroid:mainfrom
Conversation
david-allison
requested changes
May 7, 2026
Member
david-allison
left a comment
There was a problem hiding this comment.
This doesn't handle the case where the IdsFile is deleted, so getIds() fails
| } | ||
|
|
||
| /** Attempt to delete the associated [IdsFile] and logs the result */ | ||
| private fun removeIdsFile() { |
Member
There was a problem hiding this comment.
Don't copy/paste code, make an extension method
Contributor
Author
There was a problem hiding this comment.
I am not able to understand this.
Member
There was a problem hiding this comment.
This code is copy/pasted from:
Instead, define idsFile.removeSafely(), either as a method on the class, or an extension method
fun IdsFile.removeSafely() {
// code
}
Comment on lines
+337
to
+343
| BundleCompat.getParcelable( | ||
| requireArguments(), | ||
| ARG_IDS_FILE, | ||
| IdsFile::class.java, | ||
| ) ?: error("IdsFile missing") | ||
|
|
||
| val ids = idsFile.getIds() |
Member
There was a problem hiding this comment.
val ids = requireArguments().requireParcelable(ARG_IDS_FILE).getIds()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose / Description
Export Dialog crashed when >60k browsed cards are selected and the user puts the app in the background.
Fixes
Approach
Imitated the approach used in
FindAndReplaceDialogFragment.ktto deal with this issue by using classIdsFilerather than usingBundle, which was overflowing when the capacity exceeded, thereby causing the crash.How Has This Been Tested?
Tested on my phone (Android 14, Xiaomi / HyperOS) using a debug build.
Both these observations have been tested. Video attached as evidence.
Learning (optional, can help others)
In
ExportDialogFragment.kt, there is a scope for code refactoring and cleanup. This would have shrunk this PR by some lines. But I intentionally avioided it in this PR as it do not fit in this scope.Export_dialog_app_reopen_issue_resolved.mp4
Checklist
Please, go through these checks before submitting the PR.