Bind backup work to the view lifecycle - #148
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 41 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Comment |
| isBackupInProgress = false | ||
| snackbar?.dismiss() | ||
| snackbar = null | ||
| pendingExportData = null |
There was a problem hiding this comment.
Pending Export Lost On Recreate
When the user starts Export and the system document picker is open, a rotation or view recreation runs onDestroyView() and clears pendingExportData. The fragment-level ActivityResult callback can still receive the picked URI afterward, but it now sees no bytes to write and reports an export error instead of saving the backup.
There was a problem hiding this comment.
No change. View teardown intentionally cancels the export and clears its payload so archive data does not outlive the view lifecycle. A later picker result is handled as a normal failed export rather than written from stale state. Retaining bytes across recreation would require the saved-state design excluded from this change.
|
Verified on Android: local export and share flows opened the expected system surfaces, cancellation completed without a crash, and existing app data remained intact. |
Summary
Validation
Greptile Summary
This PR binds backup work to the fragment view lifecycle. The main changes are:
Confidence Score: 4/5
The local document export flow needs a fix before merging.
app/src/main/java/io/nekohasekai/sagernet/ui/BackupFragment.kt
Important Files Changed
Reviews (1): Last reviewed commit: "fix(backup): bind export work to lifecyc..." | Re-trigger Greptile