Skip to content

ADFA-5151 fix(clone): confine the receive to the recovery loop, once accepted - #411

Merged
luisguzman-adfa merged 4 commits into
mainfrom
fix/ADFA-5151-confine-to-recover-hub
Aug 15, 2026
Merged

luisguzman-adfa merged 4 commits into
mainfrom
fix/ADFA-5151-confine-to-recover-hub

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

ADFA-5151 — confine navigation to the Recover hub, once a transfer is accepted

Completes the systemless recovery flow (after ADFA-5147 / 5150 / 5152). A clone-receive
is the way a systemless phone gets a system; this makes its lifecycle whole — the user
is free to decide up to the point they commit, protected after, and never stranded or
dropped onto a systemless Home.

What changed (CloneFragment, + LibraryActivity.openLibraryTab)

  • Success exit. A completed receive no longer strands the user on step 2: the
    progress screen confirms ("Copy complete", 100%) and after 3s goes to the Library,
    exactly as the install index does. In the shared terminal, so a normal receive gets it
    too. (db1eb10c.)
  • Skip the fork. With no system, Clone enters receive step 1 directly — Send is dead
    (5150), so Receive is the only real move.
  • Back confined once accepted. Before acceptance (JOIN / CONFIRM) Back is free — the
    user is still deciding. Once the transfer is running, a Back guard (mirroring
    BackupJobFragment's) warns on the first press and backgrounds the app on the next; the
    copy keeps running under CloneShareService and the notification returns to progress
    (ADFA-5152). Back never reaches a systemless Library/Connect.
  • Failure routes. The terminal offers Retry (re-scan; rsync resumes from the
    half-written tree) or Recover (the hub); never a dead receive.

One new string (the Back warning) in all 33 locales; Retry/Recover/Copy-complete reuse
existing strings.

Design note

Confinement begins at acceptance, not at receive entry — trapping someone still
deciding would be the opposite error. The loop is a funnel, not a cage: leaving the app
is always allowed and the transfer survives. Exit is defined on both ends — success →
Library, failure → Retry/Recover — so the loop is never a trap with no way out.

Verification

Symbols, XML and locale counts checked; no build here (gradle offline). On-device: with
no system, Clone opens on receive step 1; Back is free before accepting and confined
after (snackbar → background → notification returns); success lands on the Library;
failure offers Retry / Recover. A normal receive (with a system) gets the success exit too.

…tranded on step 2

A successful clone-receive left the user on the receive screen — the transfer was
done but nothing moved them on. The install index has always redirected home on
success; the receive did not.

showReceiveTerminal now, on success, confirms briefly on the progress screen ("Copy
complete", 100%, no Cancel) and after 3s goes to the Library tab, where
LibraryHomeFragment refreshes onto the system releaseCloneEnv just booted. A
receiveExiting flag holds the confirmation so onTransferState's renderReceive (SUCCESS
is not active) can't tear it down first. Failure keeps the existing dialog.

It lives in the shared terminal, so a normal receive gets the same exit. openLibraryTab
mirrors openCloneTab. This is the success exit ADFA-5151's loop needs before the
confinement can be added safely — the door before the walls.
… fork with no system

Two pieces of the recovery confinement, on top of the success exit.

No system → CloneFragment enters receive step 1 directly, skipping the Send/Receive
fork: Send is dead (ADFA-5150), so Receive is the only real move and the fork is a
screen with one live option. The user is still free to back out until they accept.

Once accepted (the receive is running, past CONFIRM) a Back guard turns on, mirroring
BackupJobFragment's: first Back warns via snackbar, the next backgrounds the app —
the copy keeps running under CloneShareService and the notification returns to
progress (ADFA-5152). Before acceptance the guard is off, so Back is free. updateBackGuard
keeps it in step with side and transfer state; any terminal turns it off. One new
string, 33 locales.
… accepted, route failure

Three pieces on top of the success exit, completing the receive loop's lifecycle.

No system → CloneFragment enters receive step 1 directly, skipping the Send/Receive
fork: Send is dead (ADFA-5150), so Receive is the only real move. Free to back out
until the transfer is accepted.

Once accepted (running, past CONFIRM) a Back guard turns on, mirroring
BackupJobFragment's: first Back warns, the next backgrounds the app — the copy keeps
running under CloneShareService and the notification returns (ADFA-5152). Before
acceptance Back is free; updateBackGuard keeps it in step and any terminal turns it off.

On failure the terminal offers Retry (re-scan; rsync resumes from the half-written
tree) or Recover (the hub), never stranding on a dead receive or a systemless Home.
One new string (Back warning), 33 locales; Retry/Recover reuse existing strings.
Second-pass finding: receiveExiting was set on the success exit and never reset — a
flag with no clear-path, the persistent-marker-nobody-clears smell we keep removing.
Navigation destroys the fragment so it normally dies with it, but resetting it in the
redirect runnable gives it an owner and a lifetime: if navigation ever no-ops,
renderReceive is not left permanently muted.
@luisguzman-adfa
luisguzman-adfa merged commit 9a75b4d into main Aug 15, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/ADFA-5151-confine-to-recover-hub branch August 15, 2026 06:17
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