server/docs/collections/collections-architecture-collection-actions.md
This document supplements collections-architecture.md with admin/owner removal and action feed semantics. It will be merged back into the main doc after the related server changes land.
collection_files to drive client behavior: action_user, action.collection_actions store for per-user pending actions (REMOVE, DELETE_SUGGESTED); /collection-actions/pending-remove exposes the REMOVE queue and /collection-actions/delete-suggestions exposes the DELETE_SUGGESTED queue.POST /collections/v3/remove-files
REMOVE action marker (soft delete for non-owners) and creates owner-facing actions instead of deleting the membership.POST /collections/suggest-delete
REMOVE marker on the membership and create two actions for the owner (REMOVE, DELETE_SUGGESTED).DELETE_SUGGESTED actions for the respective file owners.GET /collection-actions/pending-remove?sinceTime=<int64>
REMOVE actions newer than sinceTime (limit 2000). Each entry includes the actor, collection, and file ID so clients can guide the owner workflow.{ "actions": [CollectionAction...], "hasMore": boolean }.GET /collection-actions/delete-suggestions?sinceTime=...
DELETE_SUGGESTED actions newer than the provided timestamp (limit 2000, same as pending remove).is_pending=false) and omits it from the response since the user already acted on it.POST /collection-actions/reject-delete-suggestions
{ "fileIDs": [ ... ] } (max 2000 IDs per request).is_pending=false) for the authenticated user, if they were still pending./collections/v3/remove-files for their own files./collections/move-files (owner-only). This inserts into the target collection and soft-deletes the membership in the source collection so the file disappears from the album while remaining owned elsewhere (see pkg/repo/collection.go:734+).POST /collections/suggest-delete removes the memberships for all non-owner files in the target collection and generates DELETE_SUGGESTED actions for each remote owner (see pkg/controller/collections/file_action.go:234–241).REMOVE action marker to let the owner handle the follow-up and also enqueues a DELETE_SUGGESTED for the owner.GET /collection-actions/delete-suggestions?sinceTime=....GET /collections/v2/diff
action in {REMOVE, DELETE_SUGGESTED} are surfaced as if deleted (isDeleted=true), and action/actionUser/private metadata are stripped.action and actionUser along with the entry; entry is not forced to deleted solely due to action markers.action in {REMOVE, DELETE_SUGGESTED, DELETE} are always masked as deleted and action details are stripped.Remove files v3
POST /collections/v3/remove-files{ "collectionID": 123, "fileIDs": [111, 222, 333] }"can not remove files owned collection owner, admins can perform remove suggestion" (see pkg/controller/collections/file_action.go)."can not remove files owned by album owner".Suggest delete
POST /collections/suggest-delete{ "collectionID": 123, "fileIDs": [444, 555] }AddFiles, RestoreFiles, or MoveFiles:
action, action_user set to NULL).created_at is refreshed only when the row transitions from deleted→active; otherwise it remains unchanged (see pkg/repo/collection.go upsert in MoveFiles).REMOVE for album-owner-owned files: owner should relocate the file (ensure it remains in at least one owned collection) and proceed with local removal from the shared album.DELETE_SUGGESTED: prompt the file owner to delete the file; accept or reject via UI./collections/v3/remove-files for their own files; they must move/relocate them before the server will let the membership disappear.collection_files gains action_user BIGINT, action TEXT (soft markers; do not flip is_deleted).collection_actions stores per-user pending actions with indexes on user_id and collection_id.RemoveFilesV3POST /collections/v3/remove-files when the album owner removes files contributed by collaborators.collection_files.is_deleted=true and bumping updation_time. created_at is left untouched so timelines remain stable.AddFiles, RestoreFiles, or MoveFiles, the associated ON CONFLICT clause now refreshes created_at only if the row transitions from deleted back to active. This keeps resurrected files ordered correctly without rewriting healthy rows.ScheduleDeletecollection_shares rows for the album are marked is_deleted=true so sharees immediately lose access.collections row is marked is_deleted=true and updation_time is bumped for diff consumers.TrashCollectionQueueV3; background workers later call TrashV3 to move all owner-owned files to trash (including the fallback path that removes any collaborator-owned leftovers).