Backup album folders drop files with the same title and never remove old entries #103

Closed
opened 2026-09-23 05:34:58 +02:00 by clawbot · 1 comment
Collaborator

Problem

The per-album view of the backup tree loses files, and keeps files that are no longer there (src/backup.ts:410-445).

  • Link names are the sanitized title alone (:422-428). Two files in one album with the same title are common: camera counters wrap (IMG_0001.JPG), and so do phone exports. The second file replaces the first's symlink, and nothing reports it.
  • Album directory names are the sanitized album name alone (:411). Two albums with the same name (one owned and one shared, say) share one directory, and the second NAME.json overwrites the first.
  • Nothing is ever removed from an album directory, so a photo taken out of an album, or a renamed album's old directory, stays forever.

Reproduced against runBackup with a stand-in library. There are two albums named Trip: album 10 holds files 1 and 2, both titled IMG_0001.JPG, and album 11 holds file 3. The result is one Trip/ directory with IMG_0001.JPG -> ../../originals/2.JPG and other.jpg. File 1 appears in no album, Trip.json lists only album 11, and the run reports failed: 0.

Definition of done

  1. Within an album directory every file gets its own link. A repeated title gets a stable suffix with the file ID, for example IMG_0001 (12345).JPG, and the same file keeps the same name from run to run.
  2. Albums whose sanitized names collide get distinct directory and JSON names, using the album ID the same way.
  3. Each run removes symlinks in an album directory that point into ../../originals/ but are no longer in that album, and album directories quak created for albums that no longer exist. Anything the user put there that is not such a symlink is never touched.
  4. The README "Backup layout" section states the naming rule.
  5. Tests cover the three cases above, and a second run over an unchanged account that changes nothing.
  6. make check green; TODO.md updated in the same commit.

Model: opus-5-5

## Problem The per-album view of the backup tree loses files, and keeps files that are no longer there (`src/backup.ts:410-445`). - Link names are the sanitized title alone (`:422-428`). Two files in one album with the same title are common: camera counters wrap (`IMG_0001.JPG`), and so do phone exports. The second file replaces the first's symlink, and nothing reports it. - Album directory names are the sanitized album name alone (`:411`). Two albums with the same name (one owned and one shared, say) share one directory, and the second `NAME.json` overwrites the first. - Nothing is ever removed from an album directory, so a photo taken out of an album, or a renamed album's old directory, stays forever. Reproduced against `runBackup` with a stand-in library. There are two albums named `Trip`: album 10 holds files 1 and 2, both titled `IMG_0001.JPG`, and album 11 holds file 3. The result is one `Trip/` directory with `IMG_0001.JPG -> ../../originals/2.JPG` and `other.jpg`. File 1 appears in no album, `Trip.json` lists only album 11, and the run reports `failed: 0`. ## Definition of done 1. Within an album directory every file gets its own link. A repeated title gets a stable suffix with the file ID, for example `IMG_0001 (12345).JPG`, and the same file keeps the same name from run to run. 2. Albums whose sanitized names collide get distinct directory and JSON names, using the album ID the same way. 3. Each run removes symlinks in an album directory that point into `../../originals/` but are no longer in that album, and album directories quak created for albums that no longer exist. Anything the user put there that is not such a symlink is never touched. 4. The README "Backup layout" section states the naming rule. 5. Tests cover the three cases above, and a second run over an unchanged account that changes nothing. 6. `make check` green; `TODO.md` updated in the same commit. Model: opus-5-5
clawbot self-assigned this 2026-09-23 05:34:58 +02:00
Author
Collaborator

Implemented in #115 (base next2): clashing file titles and collection names get their ID added, and each run removes stale symlinks into originals/ and the folders of deleted or renamed collections, leaving anything else alone.

Model: opus-5-5

Implemented in https://git.eeqj.de/sneak/quak/pulls/115 (base `next2`): clashing file titles and collection names get their ID added, and each run removes stale symlinks into `originals/` and the folders of deleted or renamed collections, leaving anything else alone. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/quak#103