Skip to content

fix(sse): use spaceid instead of itemid when refreshing drive on space membership SSE events#13761

Closed
dj4oC wants to merge 1 commit intoowncloud:masterfrom
dj4oC:fix/sse-space-member-drive-id
Closed

fix(sse): use spaceid instead of itemid when refreshing drive on space membership SSE events#13761
dj4oC wants to merge 1 commit intoowncloud:masterfrom
dj4oC:fix/sse-space-member-drive-id

Conversation

@dj4oC
Copy link
Copy Markdown
Contributor

@dj4oC dj4oC commented May 6, 2026

Summary

  • In the three SSE handlers for space membership changes (space-member-added, space-member-removed, space-share-updated), getDrive was called with sseData.itemid instead of sseData.spaceid
  • itemid carries the item-ID format (storageId$spaceId!nodeId), but getDriveBeta expects the drive-ID format (storageId$spaceId)
  • For entitlement-managed spaces using OCIS_CLAIM_MANAGED_SPACES_REGEXP with a gp- prefix, nodeId === spaceId, making the malformed suffix visible and causing an immediate 404

Root cause

packages/web-runtime/src/container/sse/shares.ts lines 24, 54, 101:

// before (wrong — itemid = storageId$spaceId!nodeId)
getDrive(sseData.itemid, sharesStore.graphRoles)

// after (correct — spaceid = storageId$spaceId)
getDrive(sseData.spaceid, sharesStore.graphRoles)

Call stack (de-minified)

SSEAdapter.onmessage          (web-client/src/sse/index.ts:69)
  → registered listener
    → onSSESpaceMember*Event  (web-runtime/src/container/sse/shares.ts)
      → getDrive              (web-client/src/graph/drives/drives.ts:15)
        → getDriveBeta        → GET /graph/v1beta1/drives/{wrongId} → 404

Test plan

  • In an oCIS deployment with OCIS_CLAIM_MANAGED_SPACES_REGEXP configured, open a project space with a gp- prefix as one browser tab
  • In another tab/session, add or remove a space member
  • Verify no 404 appears in the network tab for /graph/v1beta1/drives/… in the first tab
  • Verify the space membership change is reflected in the first tab's UI

🤖 Generated with Claude Code

…pace membership change

For entitlement-managed spaces with a gp- prefix (OCIS_CLAIM_MANAGED_SPACES_REGEXP),
the SSE itemid has the form storageId$spaceId!nodeId. Because nodeId equals spaceId
for these spaces, the suffix is visible and causes getDriveBeta to return 404.

The three space-membership SSE handlers (space-member-added, space-member-removed,
space-share-updated) were passing sseData.itemid as the drive ID, but getDriveBeta
expects only storageId$spaceId. Switch to sseData.spaceid, which carries the correct
drive-ID format for all space types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@update-docs
Copy link
Copy Markdown

update-docs Bot commented May 6, 2026

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@dj4oC dj4oC closed this May 6, 2026
@dj4oC dj4oC deleted the fix/sse-space-member-drive-id branch May 6, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant