Versions: moving a file between encryption groups shows its current content as a version #941

Closed
opened 2026-10-16 21:15:47 +00:00 by Cordy · 2 comments
Owner

Found in the fix-922 Task 6 review (2026-10-16).

What happens:

  • When a file moves to a folder in another encryption group, encrypt re-encrypts the file and its version records separately (internal/storage/encrypt/group.go ~101).
  • Afterwards the record of the current content no longer matches the file. So the Versions list shows the current content as an older version, and the next save records the same content again.
  • Nothing is lost, but the list gains a duplicate entry.

Expected: after a cross-group move, the current content's record is still recognised as the current one, and stays hidden as on any other file.

To do:

  • Re-encrypt the current content's record so that it keeps the identity of the moved file, or re-establish that identity after the move.
  • Add a stacktest on posix-encrypt and s3-encrypt covering this.
Found in the fix-922 Task 6 review (2026-10-16). **What happens:** - When a file moves to a folder in another encryption group, `encrypt` re-encrypts the file and its version records separately (`internal/storage/encrypt/group.go` ~101). - Afterwards the record of the current content no longer matches the file. So the Versions list shows the current content as an older version, and the next save records the same content again. - Nothing is lost, but the list gains a duplicate entry. **Expected:** after a cross-group move, the current content's record is still recognised as the current one, and stays hidden as on any other file. **To do:** - Re-encrypt the current content's record so that it keeps the identity of the moved file, or re-establish that identity after the move. - Add a stacktest on posix-encrypt and s3-encrypt covering this.
Cordy closed this issue 2026-10-17 20:40:31 +00:00
Author
Owner

Shipped in v0.6.349 (PR #959). Both dogfoods run it.

  • Moves across key scopes are recorded. When a file moves between key scopes (for example from a home into a space), Cairn now records the moved file in the destination's chain. The file therefore still names its record, and the current content no longer appears as a version.
  • Failed destination record. If the destination record cannot be made, the file is recorded at its old path and renamed as before. This logs the WARN versions: move not recorded at the destination, renamed.
  • Note for Nikola: one ruling of mine needs your check. No explicit decision existed for this case. I followed the existing R3/I2 rule: moves go ahead unrecorded rather than being refused.
**Shipped in v0.6.349 (PR #959). Both dogfoods run it.** - **Moves across key scopes are recorded.** When a file moves between key scopes (for example from a home into a space), Cairn now records the moved file in the destination's chain. The file therefore still names its record, and the current content no longer appears as a version. - **Failed destination record.** If the destination record cannot be made, the file is recorded at its old path and renamed as before. This logs the WARN `versions: move not recorded at the destination, renamed`. - **Note for Nikola: one ruling of mine needs your check.** No explicit decision existed for this case. I followed the existing R3/I2 rule: moves go ahead unrecorded rather than being refused.
Author
Owner

Live result (both dogfoods, v0.6.349, 2026-10-18; recorded on PR #959, copied here): PASS.

I moved /home/b12-live/a.txt, which had 2 versions, into /spaces/test and back. This crosses key scopes. The tests ran on files (posix, link mode) and on files-bao (Garage, copy mode).

  • The destination listed exactly the same 2 versions.
  • The current content was not listed among them, and no duplicate version was added.

The test data has been removed.

**Live result (both dogfoods, v0.6.349, 2026-10-18; recorded on PR #959, copied here): PASS.** I moved `/home/b12-live/a.txt`, which had 2 versions, into `/spaces/test` and back. This crosses key scopes. The tests ran on files (posix, link mode) and on files-bao (Garage, copy mode). - The destination listed exactly the same 2 versions. - The current content was not listed among them, and no duplicate version was added. The test data has been removed.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#941
No description provided.