Skip to content

K2GO-591 fix(clone): mark the library damaged only after the first write - #818

Merged
luisguzman-adfa merged 1 commit into
mainfrom
fix/K2GO-591-clone-list-fail-no-damage
Nov 22, 2026
Merged

luisguzman-adfa merged 1 commit into
mainfrom
fix/K2GO-591-clone-list-fail-no-damage

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What changes

  • The Clone receiver writes the install marker (files/.install_in_progress) at the first write into the library, not when the user taps "start copying".
  • ChunkedPull calls a new SyncListener.onWriteStarting() after the dry-run file list and before the first chunk. The call and stop() use the same lock: after stop() returns, the call has finished or will not come.
  • CloneFragment writes the marker in onWriteStarting(). On cancel it reads the marker from the disk, like the rebind and terminal paths do.

Why

A receive that failed at the file list (for example on an old pairing code: rsync exit 5) changed the marker to DAMAGED:CLONE on an intact library. The next start showed "Copy interrupted ... the system can't start". The marker on the disk stays the one source; the CLONE environment lock keeps the server stopped during the file list, as before.

Steps to QA

Baseline (main e3fd1cc), sender OnePlus 7T, receiver Samsung A16, same Wi-Fi:

  1. Pair the receiver with code 1, stop at "Continue - start copying".
  2. Force-stop and restart the sender app, start Send again (code 2).
  3. Tap "Continue - start copying" on the receiver. Result: "Copy stopped", marker DAMAGED:CLONE, cold start shows "Copy interrupted".

Change, the same steps:

  1. "Copy stopped", no marker, cold start shows "Ready to explore", library size unchanged.
  2. Start a real copy with code 2 and cancel after the first chunk: marker DAMAGED:CLONE and "Copy interrupted" (K2GO-562 unchanged). "Retry the copy" finishes and clears the marker.

Verifications

  • Evidence is in the Jira ticket K2GO-591.
  • Build and unit tests (assembleStandardDebug, testStandardDebugUnitTest) pass.
  • Deferred: the failure dialog offers "Recover" on an intact library. Separate UI change.

Notes

No new strings, no UI change.

A receive that failed at the file list (for example on an old pairing
code) left DAMAGED:CLONE on an intact library. The marker now comes with
the first write.
@luisguzman-adfa
luisguzman-adfa merged commit 20fc7a7 into main Nov 22, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-591-clone-list-fail-no-damage branch November 22, 2026 10:00
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