Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

fix(SetDueDateDialog) : TransactionTooLargeException

Open Alok-Silswal opened this issue 6 months ago • 5 comments

Purpose / Description

Set Due Date Dialog crashed when >60k browsed cards are selected and the user puts the app in the background.

Fixes

  • Fixes #20509

Approach

Imitated the approach used in FindAndReplaceDialogFragment.kt and Export Dialog to deal with this issue by using the class IdsFile rather than using Bundle, which was overflowing when the capacity exceeded, thereby causing the crash.

Modified newInstance API in unit tests to make it consistent with the approach used in this PR.

How Has This Been Tested?

Tested on my phone (Android 14, Xiaomi / HyperOS) using a debug build.

I reproduced the issue. It

  • directed me to the main screen: when I waited for some time (maybe 10 seconds or so)
  • showed error/crash: when I re-opened instantly

Both these observations have been tested. Video attached as evidence.

Checklist

Please, go through these checks before submitting the PR.

  • [x] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [x] You have commented your code, particularly in hard-to-understand areas
  • [x] You have performed a self-review of your own code
  • [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [ ] UI Changes: You have tested your change using the Google Accessibility Scanner

https://github.com/user-attachments/assets/d4c3e49e-62f5-40f2-93f6-058713535b55

Alok-Silswal avatar May 16 '26 17:05 Alok-Silswal

merged! Please rebase + remove the merge commits in the history

david-allison avatar May 17 '26 02:05 david-allison

Handle it outside getIds for now with a try catch

david-allison avatar May 21 '26 07:05 david-allison

I have done squash merge. One additional commit is due to merge conflict resolution due to changed position of a utils.

Alok-Silswal avatar May 24 '26 20:05 Alok-Silswal

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar Jun 07 '26 22:06 github-actions[bot]

@criticalAY I am still awaiting for your response so that I can commit changes.

Alok-Silswal avatar Jun 15 '26 09:06 Alok-Silswal

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar Jun 29 '26 10:06 github-actions[bot]

@criticalAY

Alok-Silswal avatar Jun 29 '26 17:06 Alok-Silswal

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar Jul 13 '26 19:07 github-actions[bot]

@criticalAY ? Could you take a moment to give me directions?

Alok-Silswal avatar Jul 13 '26 19:07 Alok-Silswal