State lives with the data again on s3: bind the ten unbound stores and pictures (#820) #822
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-820"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #820. Awaiting review before merge.
What changes
statePathsmoves out ofmain()intocmd/cairnd/statepaths.goand gains the eight JSON stores (spaceids, spacemeta, spacequota, spacealerts, tags, favorites, recents, activity). They already usedstatestore.Read/Write; only the binding was missing.statestore.Blobs(read cache incl. misses). On s3:Backend.Sub("avatars"|"spaceimg")→.cairn-state/avatars/<user>.jpg.age,.cairn-state/spaceimg/<id>.jpg.age. On posix: the same local dirs as before (byte-identical layout, no migration).MigrateDir(the #154 adopt-or-refuse rule per picture) and retires local copies to*.migrated.Sub; before this, key rotation would have failed on every picture.TestEveryStateFileIsBoundparsesmain.go; everyfilepath.Join(filepath.Dir(cfg.…), "<name>")must be instatePathsorlocalOnlyState. Verified red: removing the #820 entries lists all eight. It also caughtmarks(leak-tracing ledger), now declared local beside audit.Tests:
go vet ./...andgo test ./...green locally; new: statestore Sub/Blobs/MigrateDir, avatar via Blobs across a "restart", keydrain sub-prefix (verified red before fix), activity burst = 1 save, guard + basename uniqueness.