Stop restoring a phantom crawl after process death#17
Merged
Conversation
setRetainInstance keeps the Runner across rotation but does nothing across process death, where the FragmentManager restores an empty RunnerFragment. onAttach then took the "create the runner" branch and started a crawl the user never asked for, and the saved progress pane was re-entered with a spinner and a Back-hijack for a crawl that no longer existed. onAttach now discards an empty restored fragment instead of auto-starting. Restore lands on the project-setup pane, not the progress pane, when no live runner exists, so the on-disk interrupted-profile flag can offer Continue without depending on onDestroy (never called on a kill). hasLiveRunner reads the reclaimed fragment straight from the FragmentManager, so it is true only for a genuine config-change reclaim. emergencyDump captures the application context at Runner construction so a crash after detach still writes its dump. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Review follow-up. The @param described the old caller that passed a detach-nullable context; the caller now passes the application context, so the comment describes the method's actual null-tolerant contract instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
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.
setRetainInstancekeeps theRunneracross rotation but does nothing across process death, where the FragmentManager restores an emptyRunnerFragment.onAttachthen took the create-the-runner branch and started a crawl the user never asked for, and the saved progress pane was re-entered with a spinner and a Back-hijack for a crawl that no longer existed.Now
onAttachdiscards an empty restored fragment instead of auto-starting. On restore, when no live runner exists, the activity lands on the project-setup pane rather than the progress pane, where the on-disk interrupted-profile flag already offers Continue. This does not depend ononDestroy, which a process kill never calls.hasLiveRunner()reads the reclaimed fragment straight from the FragmentManager, so it is true only for a genuine config-change reclaim. Separately,emergencyDumpnow captures the application context atRunnerconstruction, so a crash afterdetach()still writes its dump.From the pre-KVM audit (findings #1, #2 high; #9 and the emergencyDump-teardown medium). Process death is not rotation and needs a device to confirm: kill the process mid-crawl, relaunch, and check that no crawl auto-starts and no fake progress UI appears.