Repository navigation
feat(collections)!: show personal collections to every profile on the login - #1875
Conversation
#1615 replaces the per-profile allow list with one switch: a shared collection is visible to every profile on the login. A collection stays shared only when its allow list already covered every profile (creator implied), so nobody gains access the owner withheld; collections shared with some profiles or with nobody else become private. Groups are deleted and each profile's collections become one flat order (group order, then position, ungrouped last). A fail-closed native column marks personal collections so Audiobookshelf rows, which share the table without allow-list rows, stay out of native listings. The allow-list and group tables stay until a later drop. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… login A personal collection now belongs to its creator alone. It is either private or shared with every profile on the login, decided at read time (Collection.VisibleTo) in both user stores, the catalog source, home rows and the library Collections tab. Only the creator changes, syncs or orders it: a collection the profile cannot see is 404 everywhere, including sync, and another profile's shared collection is 403 on every mutation (#1614). Each profile orders only its own collections, so one profile can no longer rearrange another's (#1616); a foreign ID in ordered_ids is 422 at body.ordered_ids. Personal collection groups are gone: groups is always empty, the groups capability false, and the group operations answer 501 until shipped native clients stop decoding them. /api/v2 drops allowed_profile_ids (approved pre-lock removals) and adds the login_sharing capability. /api/v1 keeps its shape: allowed_profile_ids reports the effective audience and is ignored on input, groups is empty and group routes answer 501. The SQLite store (schema v30) and the bridge importer apply the same sharing rule, and the importer's digest covers the converted values. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… sharing Adds a personal collections API reference for client developers and updates the native contract section, the capability notes, the bridge importer mapping and the v1 removals table for #1615. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rver The Collections page now lists the profile's own collections as one flat reorderable grid with a Shared badge, other profiles' shared collections under Shared with me grouped by owner (by Name, no actions, in the login's profile order), and server collections unchanged. Personal collection groups are gone from the page and the client. Every editor and the template import form use one Show to other profiles switch instead of the account share switch and profile picker. Add to Collection offers only the profile's own manual collections, so it no longer offers collections the server refuses (#1614). Library tab cards from another profile read "by Name". Opening another profile's collection editor directly stays read-only and names its owner. The ownership/partition helper and the switch are standalone pieces the list-page rebuild can reuse. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A home row configured with another profile's private collection must stay empty, and a shared one must show only what owner and viewer can both access. No test failed when the fetcher's visibility check was removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The library tab listing now includes other profiles' shared collections on the same login, but its comments still said personal collections are private to their owner. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An old API replica running against the migrated database writes rows without the native mark, which new replicas never list, and can store a subset share that the new rule reads as login-wide. Record the stop-all-replicas release note requirement and that the cleanup migration repeats the backfill. Also stop claiming native clients already hide management actions; that work is still pending. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The prior #193 S1 result (build 927) predates the switch from per-profile allow-list visibility to login-wide Unblocks: #193 S6 and #195 W5 are ready to re-test against the #1616 order change; #193 S7 and #195 W7 are ready to test against #1615. No validation result is implied. The
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
Validation line updated to the suggested one (W5 under unblocks, W6 added), and Problem now explains why #193 S1 and S2 change and need a fresh run after merge. |
…ctions-login-sharing # Conflicts: # web/src/pages/LibraryCollections.test.tsx # web/src/pages/SmartCollectionWizard.tsx
|
The updated
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
…aring # Conflicts: # contracts/api/v2/fixtures/get_system_info_ok.json
Brings in login-wide personal collection sharing (#1875), the scrobble lock fix (#1887), and the import owner-access fix (#1874). Conflict resolution keeps both sides: the capabilities test expects login_sharing and create_description, the fixture list keeps collection_order_foreign_id before this branch's appended cases, and the create-description DB test no longer sets the removed AllowedProfileIDs. The OpenAPI document, fixtures, and web types are regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…view-posters Brings in login-wide personal collection sharing (#1875), the scrobble lock fix (#1887), and the earlier phase-1 merges from feat/collections-revamp. Capabilities now advertise both login_sharing and preview_posters, the fixture deps carry the shared collection alongside the preview view, and the preview fixture case stays appended after the create-description cases. Generated contract artifacts were regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…emplate-summaries Brings in personal login sharing (#1875), the scrobble lock fix (#1887), and the preview-poster work. The only conflict was the contract digest in get_system_info_ok.json; regenerated the OpenAPI document, fixtures, and web types after the merge. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…es' into feat/api-collection-capabilities-sync Brings in personal login sharing (#1875), the scrobble lock fix (#1887), and the phase-1 collection PRs. The personal capability test now expects both login_sharing and this branch's mdblist_search and schedule_time_zone. The OpenAPI document, fixtures, and web types are regenerated, with the admin collection capability fixture still appended last. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…-sync' into feat/api-personal-sync-schedule Brings in #1875 login-wide personal collection sharing and the scrobble lock fixes. The sync_schedule update field and sync_cadence response field sit on top of #1875's model: allowed_profile_ids is gone from /api/v2, the group_id doc now says groups are unsupported, and the schedule DB test creates shared collections without an allow list. Contract artifacts are regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… into feat/api-collection-row-references Brings in the base's personal login sharing (#1875), the scrobble lock fix (#1887), and the phase-1 API branches. The only conflict was the contract digest in get_system_info_ok.json; the OpenAPI document, fixtures, and web types were regenerated from the merged router. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…es' into fix/sections-missing-collection-log Brings in the moved feat/collections-revamp base (#1875 personal login sharing, #1887 scrobble lock fix) through the row-references branch. The merge applied cleanly; the missing-collection logging tests pass under the login-wide sharing model without changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rged An approval lives only on the pull request that needs it. The #1615 removals merged into feat/collections-revamp with #1875, so these entries now match no change and fail the contract gate. The record stays in the file's history; the final merge into main carries them again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…log' into feat/api-collections-contains-item Brings in login-wide personal collection sharing (#1875), the scrobble lock fix (#1887), and the earlier phase-1 collection PRs. The contains_item tests now create shared collections with is_shared alone, since allowed_profile_ids is gone. The capability test expects both login_sharing and contains_item. The fixture list carries the shared collection, which gets no contains flag. Contract artifacts were regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…hat they merged An approval lives only on the pull request that needs it. The Silo-Server#1615 removals merged into feat/collections-revamp with Silo-Server#1875, so these entries now match no change and fail the contract gate. The record stays in the file's history; the final merge into main carries them again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo-Server#1875 replaces the per-profile allow list with one rule: a personal collection's creator sees it, and every profile on the login does when it is shared; Audiobookshelf rows (native = false) never reach native reads. The BoxSet store predicate and the signed-image lookup follow it, and the tests and docs move from allow lists to the creator and shared flag. An Audiobookshelf collection opted into server collections no longer becomes a BoxSet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… into main The approvals were dropped on the integration branch after #1875 merged into it, but the contract check for the merge into main compares against main, where allowed_profile_ids still exists. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Problem
Related issue: #1615
Related issue: #1614, #1616 (fixed here; they close when
feat/collections-revampmerges intomain)Validation tasks: unblocks #193 S6, S7, #195 W5, W7; changes #193 S1, S2, #195 W1, W2, W3, W6, Silo-Server/silo-apple#20 C1, C2, C6, Silo-Server/silo-apple#21 C1, C2, C6, Silo-Server/silo-android#5 C1, C2, C6 and Silo-Server/silo-android#6 C1, C2, C6
On a login with several profiles, one profile can rearrange another profile's personal collections, and the web offers actions on other profiles' collections that the server then refuses. Ordering ignores who created a collection, so when one profile reorders its collections, another profile's list changes (#1616). Personal collection groups belong to the whole login, so one profile's group edits move collections for everyone. The web shows Delete, Sync and Add to Collection on collections the profile didn't create, and the server refuses them (#1614). Sharing itself is a per-profile allow list.
This change applies the #1615 model. A personal collection belongs to the profile that created it, and only that profile changes it. One Show to other profiles switch shows it, read-only, to every profile on the same login, including profiles added later. Existing collections are migrated, personal collection groups stop working, and the web Collections page splits into Your collections, Shared with me and Server collections. The change this one builds on already limits what a viewer sees in a shared collection to titles both the owner and the viewer can access.
#193 S1 (build 927) and S2 (build 1012) were recorded under the per-profile allow list. Who can list and read a shared collection now follows the login-wide
is_sharedrule, and create, update and cross-profile reads go through the new visibility and native-row checks, so both need a fresh run after merge.Approach
Visibility is one rule, decided when a collection is read: the creator sees it, and so does every profile on the same login when
is_sharedis true. Both user stores, the cataloguser_collectionsource, home rows, the library Collections tab, sync and the v1 and v2 handlers use it. No per-profile rows are stored or read.Audiobookshelf (beta) collections and playlists live in the same PostgreSQL table, and until now the allow list was the only thing keeping them out of native routes. A new
nativecolumn does that job now. It defaults to false, native writers set it, and rows where it is false never appear on a native route.A collection the profile can't see answers 404 on every operation; sync answered 403 before. A visible collection the profile doesn't own answers 403 to every change.
Each profile has one flat order of its own collections.
reorderCollectionsaccepts only the acting profile's own IDs, and any other ID is a 422validation_failedatbody.ordered_ids.listCollectionsreturns the profile's own collections first, then other profiles' shared ones grouped by owner, each in its owner's order.Groups are removed in two steps because shipped Apple and Android builds require
groupsin the list response and the capability document. This change keeps them with fixed values:groupsis always[], thegroupscapability is false, and the six group operations and settinggroup_idanswer 501capability_unsupported, as they already do for an account on the SQLite user store. A follow-up removes them from/api/v2before the lock, once silo-apple#534 and silo-android#406 ship./api/v2:allowed_profile_idsis removed from the personal collection schemas, andCollectionCapabilities.login_sharing: trueis added so clients can tell which model a server uses./api/v1:GET /api/v1/collectionsreturns own and shared collections.allowed_profile_idsreports the effective audience (the creator alone, or every profile on the login) and is ignored on input.groupsis always[], the group routes answer 501, andPUT /api/v1/collections/orderaccepts only a null or absentgroup_id. The v1-scope removals table records this.Migration
20261003235347_personal_collection_login_sharing:user_collection_groupsand adds an index on(user_id, creator_profile_id, sort_order)Down rewrites the allow lists from
is_shared, so older code reads the visibility the new code showed. It doesn't restore groups or the previous order. The retired tables stay until a later migration drops them. The SQLite user store (schema v30) and the SQLite bridge importer apply the same sharing rule, and the importer no longer copies allow-list rows.Web:
item_reordercapability is on.Docs: a new
docs/collections-api.mdcovers the model for client authors. The personal collections section ofdocs/architecture/api-contract.mdis rewritten, anddocs/catalog-api.md,docs/architecture/v1-scope.mdanddocs/architecture/sqlite-bridge-preflight.mdare updated.Validation
Go build,
gofmt,go vet ./...andmake lint-changedagainst the base branch: clean.go test ./...without a database: pass, except one jellycompat playback test this change doesn't touch (TestHandlePlaybackPositionlessStoppedUsesQueuedReportPosition). It is timing-sensitive and fails intermittently on the base branch too.DB-backed tests on freshly migrated PostgreSQL databases, with the session time zone set to UTC. They cover the changed packages and their dependents: userstore, userdb, usercollections, sections, notifications, apiv2, migrations, api, handlers, catalog, access, audiobooks, metadata, jellycompat and database. All pass except six tests that fail the same way on the base branch:
TestAdminSubtitleListPageDB,TestCatalogTransferPersistsJobsAndSignedLink,TestOrphanCleanupAfterPlexTableDropPostgres,TestRecordOutcomeClearsTheParkedRetry,TestSyncMergeStepsAfterPlexTableDropPostgresandTestPostgresSubtitleLanguageBackfill.The new tests cover:
The visibility tests fail when the visibility check or the
nativefilter is removed.SQLite bridge importer: the new sharing-rule test passes. The existing account-import DB tests fail on the base branch too, because the frozen schema-22 source fixture lacks
profiles.max_advisory_age.make test-db-pins: every pin passes.Contract and generated artifacts:
verify-apiv2-openapi,verify-apiv2-contract(19 changes, none breaking without an approval),verify-apiv2-fixtures,verify-apiv2-web-types,TestCommittedArtifactMatchesRouter,verify-migration-ledger,verify-route-inventory,verify-scenario-catalogs,verify-offline-routes,verify-settings-bindings-all,verify-playback-fixturesandverify-local-pathsall pass.Scenario executor against a live database (outside the CI gate): the same nine
/api/v1catalogs fail on this branch and on the base branch, with identical failing cases. None of them covers collections.Web: lint (no errors, and no new warnings in changed files), format check, build, bundle budget and the full Vitest suite (
make test-web) pass.Not run: nobody has walked the Collections — Server #193 or Collections — Web #195 cases on a running server or in a browser, run shipped Apple or Android builds against this server, or tried an upgrade with old and new replicas.
Risks
is_sharedbut not the old allow lists, groups or order.native, so they never appear on native routes. It can also storeis_sharedfor an allow list that covers only some profiles, which the new rule reads as shared with the whole login. The later migration that drops the retired tables repeats the backfill and the sharing rule, so such rows are recovered without widening access.docs/architecture/api-contract.mdrecords this.groupsstays (empty) and thegroupscapability stays (false). Any group a native user had is gone, and group actions answer 501./api/v2request schemas no longer acceptallowed_profile_ids, and an unknown field is a 422. Apple doesn't send it. Android declares it with a null default that its JSON setup leaves out. That conclusion comes from reading the code; it hasn't been confirmed on a device./api/v1list responses now include other profiles' shared collections, and the group routes answer 501.collection_group_staleis replaced bycollection_group_unsupported, so client copies of the fixtures need a refresh.feat/collections-revampmerge intomainhas to carry them again.nativedefaults to false.Checklist
AI Disclosure
docs/architecture/api-contract.md, and a commitment that the later table-drop migration repeats the backfill together with the sharing rule. The backfill alone would have widened partial shares.docs/collections-api.mdsaid native clients already hide management actions. It now says only the web client does.🤖 Generated with Claude Code
Note
Replace per-profile collection sharing and groups with login-wide sharing
is_sharedflag. The per-profile allow list (allowed_profile_ids) and collection groups are removed from the API contract, store types, and the web client.ReorderCollectionsin collections.ts.capability_unsupported, and reorder requests reject a non-nullgroup_idor a foreign collection ID with 422 atbody.ordered_idsin personal_collections.go. A newlogin_sharing=truecapability is advertised.allowed_profile_idsfromis_shared(creator for private, all login profiles sorted for shared) in collections.go.allowed_profile_idsrequest/response fields and all group operations (approvals recorded in breaking-approvals.json); the v30 migration and its Down path permanently drop collection groups and prior ordering; shared collections whose old allow list did not include every login profile silently become private.Macroscope summarized d489b57.