Skip to content

Deleting a whole save folder: "emptied" or "missing"? And a lead in the served-manifest proof #66

Closed

Description

@ChakraFusion

A long hunt for random Windows CI failures (about 155,000 runs) turned up the fixes in #61–#65, and two things that need your decision rather than a fix from me.

1. A deleted save folder: "emptied" or "missing"?
When a whole save folder is deleted, Windows removes the files before the folder. If the watcher sees the files go first, the game is held as emptied ("its save files were all deleted here; it is not synced until you say whether that was meant"). A moment later the folder is gone too, but the existing hold isn't cleared by the folder being missing, and it stays even after the folder comes back. No data is lost either way, and the other device's copy is safe. The question is which behaviour users should get.

TestMissingFolder_DoesNotWipeThePeer already accepts either outcome. Its sister TestMissingFolder_ARestartDoesNotRecreateItEmpty expects "missing" and failed with a 409 "held" 4 times in 701 runs. The options:

  1. Accept both and fix the test. The smallest change, but whether users are asked depends on timing, and the hold outlives the folder coming back.
  2. Let "missing" win (my suggestion). Drop the hold once the whole folder is gone, pause quietly, and resume when it returns. That's predictable and matches the missing-folder design. Someone who deleted the folder on purpose isn't asked, which is already the case when "missing" is seen first.
  3. Let "emptied" win. Always ask, even for a missing folder. The most cautious option, but it changes the quiet missing-folder behaviour.

2. A lead in the served-manifest proof
In SyncWithPeer, the served-manifest proof (servedUnderBase) banks a base without updating the shared-files record, like the push proof did before #65. With only a served record on file, a deleted file comes back the same way. That was shown with injected state; I found no natural path to it. Giving it #65's repair is unsafe, because served records live in memory and survive an untrack, so a re-tracked game banked the peer's files as shared and deleted them, in every run of TestUntrack_LateLineageWriteMustNotSurviveIntoARetrack and TestUntrackThenRetrack_DoesNotInheritStaleLineage. A safe fix would clear served records on untrack first. Would you like that?

🤖 Generated with Claude Code

Activity

  1. Omar-VF commented on Oct 15, 2026

    @Omar-VF
    Collaborator

    Thanks for the long hunt. #61–#65 have made CI much more trustworthy, and these two are good calls to bring to us rather than decide alone.

    1. Deleted folder: "missing" wins (your option 2). Please drop the emptied hold once the whole save folder is gone, pause quietly as a missing folder does, and resume when it returns. One condition: when the folder comes back empty, or with fewer files than both devices last shared, the usual emptied check has to run again at that point. A folder that a game or an uninstaller recreates empty must still be held back and asked about, never synced as deletions. A test for that "comes back empty" case alongside TestMissingFolder_ARestartDoesNotRecreateItEmpty would be great.

    2. Served-manifest proof: yes, please. Clear the served records when a game is untracked first, then give servedUnderBase the same repair #65 adds, with the same exception while a game is held as emptied. Clearing those records on untrack is worth having on its own, so it can be its own commit or PR if that's easier to review.

    Both against dev-public as before.

  2. ChakraFusion commented on Oct 15, 2026

    @ChakraFusion
    Author

    Thanks! Both are up: #69 ("missing" wins, with the check when the folder returns, including the "comes back empty" test next to TestMissingFolder_ARestartDoesNotRecreateItEmpty) and #70 (served records cleared on untrack, then the served-manifest repair with the emptied-hold exception, as two commits). #69 also turned up a data-loss case: a folder that came back with only some of its files had the rest deleted on the other device.

  3. ChakraFusion commented on Oct 16, 2026

    @ChakraFusion
    Author

    Closing: both points are done and merged. #69 ("missing" wins, with the check when the folder comes back empty or with fewer files) and #70 (served states forgotten on untrack, then the served-manifest repair). Thanks for deciding them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions