Skip to content

Stop restoring a phantom crawl after process death#17

Merged
xroche merged 3 commits into
masterfrom
fix/process-death-restore
Jul 18, 2026
Merged

Stop restoring a phantom crawl after process death#17
xroche merged 3 commits into
masterfrom
fix/process-death-restore

Conversation

@xroche

@xroche xroche commented Jul 18, 2026

Copy link
Copy Markdown
Owner

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.

Now onAttach discards 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 on onDestroy, 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, emergencyDump now captures the application context at Runner construction, so a crash after detach() 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.

xroche and others added 3 commits July 18, 2026 18:58
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>
@xroche
xroche merged commit 7293327 into master Jul 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant