openreader/src/lib/server/user
Richard R c0de2156fe refactor(documents): centralize owned document deletion and add mutation locking
Introduce `deleteOwnedDocument` utility to encapsulate all logic for removing a user's ownership of a document, including TTS segment cache cleanup, preview artifact removal, and S3 blob deletion for last-owner cases. Add `withDocumentMutationLock` to serialize concurrent mutations on the same document, using advisory locks in Postgres and a local queue fallback. Refactor all API routes and user data flows to use these utilities, ensuring transactional safety and preventing race conditions during document deletion or transfer. Update tests for new flows and add coverage for document cleanup sequencing and locking behavior.
2026-06-06 18:09:47 -06:00
..
claim-data.ts refactor(documents): centralize owned document deletion and add mutation locking 2026-06-06 18:09:47 -06:00
data-cleanup.ts refactor(documents): centralize owned document deletion and add mutation locking 2026-06-06 18:09:47 -06:00
data-export.ts test(user): expand cleanup and export coverage for shared docs and TTS segment files 2026-06-06 17:38:30 -06:00
legacy-fs-claim-cleanup.ts feat(user): remove legacy local file deletion and add cleanup for claimed FS sources 2026-06-03 14:35:27 -06:00
preferences-normalize.ts fix(config): prevent arrays from being treated as records in preference normalization 2026-06-06 15:55:54 -06:00
preferences-payload.ts feat(preferences): add changelog version tracking and payload meta support 2026-05-14 10:53:38 -06:00
resolve-state-scope.ts refactor(api): remove all legacy unclaimed user scope logic and enforce strict userId scoping 2026-05-31 13:01:55 -06:00