Open Cloud Mesh shares out of a Personal folder do not follow a rename and are not guarded by the item id #1057

Closed
opened 2026-10-31 07:48:25 +00:00 by Cordy · 4 comments
Owner

Problem. An OCM share to a user on another instance (internal/ocm, ShareOut{Path, LocalUser, ...}) binds to a path. Renaming or moving the shared item in Cairn leaves the OCM share on the old path: the remote side gets 404. Worse, a different item that later takes the old path is served to the remote recipient: the path-reuse gap that #835 closed for public links and person and group shares is still open for OCM shares. A delete into Deleted files does not pause them either.

Today. #835 (v0.6.376) covers links and grants in the share store only; OCM keeps its own records (ocm state, sharesOut). The handbook names it as a known limit (sharing.md, Known limits of Personal links and shares).

Proposal.

  • Store the item id (ownermeta EnsureItemID) on each new ShareOut, stamp existing ones once (as stampItemIDs does for the share store), and check it in the OCM WebDAV handler (/dav/ocm/<providerId>/) with share.CheckItem: a different item answers 404.
  • Follow renames and moves inside the owner's Personal folder through the same actrec move hook (composeShareHooks); end on a confirmed move out (with the existing confirm counting OCM shares too) and refuse otherwise; pause with Deleted files, resume on restore, end on purge.
  • Check whether the remote side needs to know of a rename (what its WebDAV URL for the share contains), and whether following locally is enough.

Acceptance. Tests: an OCM share on a file, the file renamed in Cairn: the remote request still reads it; a new file at the old name is never served to the remote; delete pauses, restore resumes.

Refs. #835 spec §14, #835 decision 7 (item guard), #1035.

Follow-up of #835 (v0.6.376).

**Problem.** An OCM share to a user on another instance (`internal/ocm`, `ShareOut{Path, LocalUser, ...}`) binds to a path. Renaming or moving the shared item in Cairn leaves the OCM share on the old path: the remote side gets 404. Worse, a different item that later takes the old path is served to the remote recipient: the path-reuse gap that #835 closed for public links and person and group shares is still open for OCM shares. A delete into Deleted files does not pause them either. **Today.** #835 (v0.6.376) covers links and grants in the share store only; OCM keeps its own records (`ocm` state, `sharesOut`). The handbook names it as a known limit (`sharing.md`, Known limits of Personal links and shares). **Proposal.** - Store the item id (ownermeta `EnsureItemID`) on each new `ShareOut`, stamp existing ones once (as `stampItemIDs` does for the share store), and check it in the OCM WebDAV handler (`/dav/ocm/<providerId>/`) with `share.CheckItem`: a different item answers 404. - Follow renames and moves inside the owner's Personal folder through the same actrec move hook (`composeShareHooks`); end on a confirmed move out (with the existing confirm counting OCM shares too) and refuse otherwise; pause with Deleted files, resume on restore, end on purge. - Check whether the remote side needs to know of a rename (what its WebDAV URL for the share contains), and whether following locally is enough. **Acceptance.** Tests: an OCM share on a file, the file renamed in Cairn: the remote request still reads it; a new file at the old name is never served to the remote; delete pauses, restore resumes. **Refs.** #835 spec §14, #835 decision 7 (item guard), #1035. Follow-up of #835 (v0.6.376).
Author
Owner

Research (2026-10-31, code at v0.6.380).

  • The remote never needs to hear of a rename: it holds share id, name at send time, owner/sender, secret, permissions and the URI /dav/ocm/<providerId>/, no path. The OCM spec (cs3org OCM-API, draft-07) calls the share id opaque and has no rename notification; Nextcloud and Reva (oCIS/OpenCloud) send the name once. Updating our side is enough.
  • Today ShareOut.Path is served by GrantHandler (internal/ocm/grant.go:44-91) with no item check, and nothing in internal/ocm reacts to rename, move, delete, restore, purge or transfer. OCM.md promises the share "ends honestly" on rename; never built. A new file at the old name would be served to the remote (path-reuse gap).
  • Competitors bind federated shares to a file/resource id and follow renames silently; Nextcloud's ownership transfer re-points them.
  • Side gaps: the OCM store loads once and rewrites whole files (#742: an ended share can re-open); departed or disabled owners' OCM shares keep serving; vanilla Nextcloud reading from Cairn probably fails (secret as Basic user answers 404; ShareOutBySecret has no caller; only Nextcloud to Cairn is live-tested); outgoing notifications lack senderDomain and notification.file.providerId from the current draft.

Recommended: the #835 lifecycle for OCM shares through the same hooks: item id stamped at send and once at start (ocm-itemids.json), guard on every method, follow inside Personal, counted in the move-out confirm, pause/resume/end with Deleted files, SHARE_UNSHARED on end, re-point paused on owner transfer, freeze for departed owners, record-level writes. Questions are being asked now. Full file: research-1057.md.

**Research (2026-10-31, code at v0.6.380).** - The remote never needs to hear of a rename: it holds share id, name at send time, owner/sender, secret, permissions and the URI `/dav/ocm/<providerId>/`, no path. The OCM spec (cs3org OCM-API, draft-07) calls the share id opaque and has no rename notification; Nextcloud and Reva (oCIS/OpenCloud) send the name once. Updating our side is enough. - Today `ShareOut.Path` is served by `GrantHandler` (`internal/ocm/grant.go:44-91`) with no item check, and nothing in `internal/ocm` reacts to rename, move, delete, restore, purge or transfer. OCM.md promises the share "ends honestly" on rename; never built. A new file at the old name would be served to the remote (path-reuse gap). - Competitors bind federated shares to a file/resource id and follow renames silently; Nextcloud's ownership transfer re-points them. - Side gaps: the OCM store loads once and rewrites whole files (#742: an ended share can re-open); departed or disabled owners' OCM shares keep serving; vanilla Nextcloud reading from Cairn probably fails (secret as Basic user answers 404; `ShareOutBySecret` has no caller; only Nextcloud to Cairn is live-tested); outgoing notifications lack `senderDomain` and `notification.file.providerId` from the current draft. **Recommended:** the #835 lifecycle for OCM shares through the same hooks: item id stamped at send and once at start (`ocm-itemids.json`), guard on every method, follow inside Personal, counted in the move-out confirm, pause/resume/end with Deleted files, SHARE_UNSHARED on end, re-point paused on owner transfer, freeze for departed owners, record-level writes. Questions are being asked now. Full file: research-1057.md.
Author
Owner

Decisions (Nikola, 2026-10-31): all research recommendations approved. The #835 lifecycle for OCM shares out of Personal: follow inside Personal (remote not notified; Cairn shows "Shared as {name}"), counted in the one move-out confirm and ended on confirmation, pause/resume/end with Deleted files, item guard on every method, SHARE_UNSHARED on end, re-point paused on owner transfer under the same checkbox, freeze for departed/disabled owners, record-level ledger writes (#742), notification fields up to the current draft, a homes-off path test. Separate issues: Nextcloud reading from Cairn (after a live check) and OCM shares in the admin Shares list. Next: whole-page mockups, then spec and build.

**Decisions (Nikola, 2026-10-31): all research recommendations approved.** The #835 lifecycle for OCM shares out of Personal: follow inside Personal (remote not notified; Cairn shows "Shared as {name}"), counted in the one move-out confirm and ended on confirmation, pause/resume/end with Deleted files, item guard on every method, SHARE_UNSHARED on end, re-point paused on owner transfer under the same checkbox, freeze for departed/disabled owners, record-level ledger writes (#742), notification fields up to the current draft, a homes-off path test. Separate issues: Nextcloud reading from Cairn (after a live check) and OCM shares in the admin Shares list. Next: whole-page mockups, then spec and build.
Author
Owner

Mockup approved (Nikola, 2026-11-01): 1057-ocm-follow-mockup.html (37 new keys) with the open points as recommended: federated shares count as shares in "shares and links" (listed by name with "federated"); "Ended" lines stay until dismissed (only for ends Cairn made); Turn on for a handed-over federated share needs no confirm; Can view / Can edit instead of read+write; the new field in the OCM shares answer is state. The first version of the file did not render (a duplicate <style> tag); it is fixed and kept as the reference of the intended look. Next: spec and build.

**Mockup approved (Nikola, 2026-11-01):** `1057-ocm-follow-mockup.html` (37 new keys) with the open points as recommended: federated shares count as shares in "shares and links" (listed by name with "federated"); "Ended" lines stay until dismissed (only for ends Cairn made); Turn on for a handed-over federated share needs no confirm; Can view / Can edit instead of `read+write`; the new field in the OCM shares answer is `state`. The first version of the file did not render (a duplicate `<style>` tag); it is fixed and kept as the reference of the intended look. Next: spec and build.
Cordy closed this issue 2026-11-02 10:33:56 +00:00
Author
Owner

Released in v0.6.385 (PR #1068), live on both dogfoods since 11:58 UTC. Pods are ready and log no new WARN or ERROR lines. The OCM stamp ran with records=0 on both, since neither dogfood has a federated share out.

What changed

  • Federated shares out now have the #835 lifecycle:
    • item id and path-reuse guard on every method;
    • follow on rename and move inside Personal;
    • move-out confirm;
    • Deleted files pause, resume and end;
    • SHARE_UNSHARED with sharedSecret, from a background sender that signs as the share's sending domain;
    • nothing is sent while OCM is off;
    • re-point (paused) on owner transfer;
    • freeze for departed owners.
  • The ledger is record-level. The peer guard accepts or declines only from pending, and only from the share's own server.
  • Shares made before this release were recorded on a wrong path. They are refused until the start stamp is done, then ended as wrong-path, and the other server is told when shares.baseUrl is set.

Follow-ups filed: #1070 (a Nextcloud reading from Cairn, live check first), #1071 (federated shares in the admin Shares list), #1072 (restore pause for federated shares out).

Live checks are in #1005.

Released in **v0.6.385** (PR #1068), live on both dogfoods since 11:58 UTC. Pods are ready and log no new WARN or ERROR lines. The OCM stamp ran with `records=0` on both, since neither dogfood has a federated share out. **What changed** - Federated shares out now have the #835 lifecycle: - item id and path-reuse guard on every method; - follow on rename and move inside Personal; - move-out confirm; - Deleted files pause, resume and end; - `SHARE_UNSHARED` with `sharedSecret`, from a background sender that signs as the share's sending domain; - nothing is sent while OCM is off; - re-point (paused) on owner transfer; - freeze for departed owners. - The ledger is record-level. The peer guard accepts or declines only from pending, and only from the share's own server. - Shares made before this release were recorded on a wrong path. They are refused until the start stamp is done, then ended as `wrong-path`, and the other server is told when `shares.baseUrl` is set. **Follow-ups filed:** #1070 (a Nextcloud reading from Cairn, live check first), #1071 (federated shares in the admin Shares list), #1072 (restore pause for federated shares out). Live checks are in #1005.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1057
No description provided.