Commit 40bf9e7
fix(upload): eagerly cancel upload work when prerequisites disappear
The worker-level gate from the previous commit caught the case
lazily (next scheduled run sees the missing prerequisite and bails),
but the cancelled work still sat in WorkManager's queue until its
backoff timer elapsed. If the retry was parked on the 32m / 1h step,
that's the window the cancelled work would sit "scheduled but doomed".
Now the three opt-out paths drop the unique-work entry immediately:
- SyncManager.clearSyncFolder → cancels BOTH workers
- SettingsViewModel.unlinkOnline → cancels eucstats
- SettingsViewModel.deleteOnline → cancels eucstats (post-success)
clearSyncFolder cancels both because eucstats's rider id file lives in
the SAF folder; losing the folder loses online identity too.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent c43fe51 commit 40bf9e7
2 files changed
Lines changed: 32 additions & 1 deletion
File tree
- app/src/main/java/com/eried/eucplanet
- data/sync
- ui/settings
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | 386 | | |
| |||
687 | 692 | | |
688 | 693 | | |
689 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
690 | 712 | | |
691 | 713 | | |
692 | 714 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2013 | 2013 | | |
2014 | 2014 | | |
2015 | 2015 | | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
2016 | 2020 | | |
2017 | 2021 | | |
2018 | 2022 | | |
| |||
2085 | 2089 | | |
2086 | 2090 | | |
2087 | 2091 | | |
2088 | | - | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
2089 | 2098 | | |
2090 | 2099 | | |
2091 | 2100 | | |
| |||
0 commit comments