Repository navigation
fix(sharing): show folder access when sharing an item and accept it without extra filing - #317
Conversation
…ithout extra filing An owner could invite a colleague directly to an item the colleague already saw through a shared folder, because the share dialog and the copy-link popover counted direct invitations only. Accepting that invitation required filing it into one of the receiver's own folders, so the item showed up twice in the receiver's tree. Owner side: - GET /api/items/[id]/shares also returns the folder audience: the folder owner and pending or accepted folder receivers, labelled with the item owner's own folder or attachment name. - The share dialog groups people by folder, labels them in search, offers no direct invite for them and links to the folder's sharing (folder owner only). inviteToItem skips them. - Copy link is never blocked. The popover and the header count distinct people across direct and folder access. Receiver side: - Invitations list the receiver's own accepted folder paths to the item. - Accept without a folder is allowed only when such a path exists, rechecked inside the share transaction. The same rule lets the receiver remove an extra filing again. - Ordinary invitations still require filing, and the dialog says why. - One ReceivedItemDialog body serves acceptance and later filing for recordings and mail. Folders created in it reach the dashboard state. - Removing a direct share says where the item stays visible and keeps the row. No schema change. Decision record: 2026-10-31-share-acceptance-with-existing-folder-access.
Review: fix(sharing): show folder access when sharing an item and accept it without extra filingImplements R1a-R4a from Verdict: APPROVE Findings: Blocker 0 | Critical 0 | Major 0 | Minor 0 | Nit 0 FindingsNone. No security, correctness, scoping or encryption issues found; raw SQL in Missing testsNone identified. The adaptation of |
Problem
An owner shared a folder with a colleague and also shared one recording of that folder directly. The colleague attached the folder and, because accepting the direct invitation required filing, filed the recording into another folder of their own. The recording then showed twice in their tree. The owner's share dialog had not shown that the colleague already saw the recording through the folder: it and the copy-link popover counted direct invitations only.
Change
Rulings R1–R4 (all option a), recorded in
documentation/adr/2026-10-31-share-acceptance-with-existing-folder-access.md:inviteToItemskips them. Only the folder owner gets "Manage folder sharing". Copy link is never blocked; the popover and the header count distinct people across direct and folder access.Server:
GET /api/items/[id]/sharesaddsfolderAudience;listMyInvitationsadds the receiver's own accepted folder paths; accept/file may omitfolderIdonly when such a path exists, rechecked inside the share transaction.outgoingItemShareConditionreuses the same audience relation. OneReceivedItemDialogbody serves acceptance and later filing for recordings and mail.No schema change, no env or deploy change.
Testing
biome check,tsc --noEmitclean.vitest run --changed origin/dev --no-file-parallelismwith Postgres 16: 6454 passed, 82 skipped (Keycloak).src/tests/sharing/share-acceptance.integration.test.ts(19 cases: both item kinds, own and foreign folders, pending/accepted/inactive recipients, invitation suppression, local names, ownership isolation, revoked paths, unfiling) and extended sharing UI suites.Relates to #260.