Skip to content

fix: update the open shares panel when another session changes shares - #4371

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/sidebar-shares-sse
Nov 11, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/sidebar-shares-sse

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

The open Shares panel now follows shares and links that another session adds, changes or removes, also for parent folders and project spaces, without losing what you're typing in the invite form.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), browser tests (Playwright) against a local OpenCloud
  • test case 1: unit: share and link events for the shown item, its parents and a project space root, own tab and other items ignored, silent failed refreshes, role changes in the panel
  • test case 2: browser: reproduced on main, then on the fix with two sessions: shares, roles, links (name, permission, expiry), removals, parent folder and project space links, own tab changes, invite form kept, closed sidebar, revoked access, Pixel 7

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

return [unref(panelContext).items[0].fileId, ...ancestorIds]
})

function refreshShares() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each share/link event triggers its own refresh, and since skipCache is set, every refresh also re-fetches the permissions of all ancestors. Sharing a file with 3 users at once from another session caused 4 permission requests for the file plus one per ancestor in the other tab. In deep folder structures or with bulk shares this multiplies quickly.

useExternalFileUpdates already keeps only the newest pending event while a handler runs. Could we do the same here (or add a short debounce), so a burst of events results in a single refresh?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6ffb2d9: share and link events are debounced now (300 ms), so a burst like that triggers a single refresh.

@AlexAndBear
AlexAndBear requested a review from tammi-23 November 9, 2026 22:23
@AlexAndBear
AlexAndBear force-pushed the fix/sidebar-shares-sse branch from 6ffb2d9 to 2df07d0 Compare November 11, 2026 17:21
@AlexAndBear
AlexAndBear merged commit de90675 into main Nov 11, 2026
28 checks passed
@AlexAndBear
AlexAndBear deleted the fix/sidebar-shares-sse branch November 11, 2026 17:48
@openclouders openclouders mentioned this pull request Nov 11, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The open Shares panel doesn't show shares or links another session adds

3 participants