Repository navigation
feat: allow sharing sessions with collaborators - #1150
Conversation
🦋 Changeset detectedLatest commit: c025b8a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…enant-wide access toggle
…rmissions in ShareSessionDialog and useShareSessionDialog
…:truefoundry/trueforge into feat/hv/session-sharing-collaborators-ui
… user-specific grants are now filtered correctly. Added a test to verify the omission of tenant grants.
Qodex review(no summary) Effort: ●●●●● (5/5) · No findings worth raising. The diff reads clean. Since last review: 0 addressed, 0 new. Scope: the changes since the last review (delta: only what changed since the previously reviewed commit c47b001 is reviewed; findings are anchored on the whole change). Qodex review threads: 0 open, 0 resolved by Qodex, 6 resolved by a reviewer. WalkthroughWhat Qodex checkedLenses (openqodex review with checked answers, all dimensions)
Scanners
Quality filters
Verification (M1b probes against PR preview)
Cross-review dedup
Output
Reviewer: 0 tool calls served, 0 model calls, 0 correction rounds, 0.0s. The library does not report tool calls asked apart from those it served, or a step cap. Every dimension is reviewed. Bugs, security, and performance post inline; low-severity style and convention notes are collected in the group above rather than dropped. Mark a finding resolved or flag a false positive in the Qodex Pull Requests view. |
…sionDialog; add tests to ensure stale updates are ignored after invites/removals.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c025b8a. Configure here.
| } finally { | ||
| collaboratorMutationsRef.current--; | ||
| collaboratorListEpochRef.current++; | ||
| } |
There was a problem hiding this comment.
Invite overwrites concurrent removals
Medium Severity
invite writes the full grantAccess snapshot into collaborators with no epoch or mutation check. A removeCollaborator that runs while the grant is in flight can be overwritten, so a revoked user reappears even after revoke succeeds.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c025b8a. Configure here.


Summary
Closes AGE-2464
Changes
How was this tested?
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,python/trueforge_sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Medium Risk
Changes how session access is surfaced and mutated in the UI; incorrect grant/revoke or capability gating could expose sharing controls or stale collaborator state, though MANAGE permissions and the host port contract limit blast radius.
Overview
Adds per-user session sharing on top of existing tenant-wide access via
session.shared. The runtime and UI gain an optionalsessionAccessport (listAccess,grantAccess,revokeAccess,searchUsers),Session.createdByfor the owner row, and asessionSharing.enabledcapability that gates invite-by-user UI.Share session dialog now supports debounced directory search, multi-select invite, owner/collaborator rows with revoke, and shows the share link when access is tenant-wide or at least one user collaborator exists (with copy toasts that reflect the audience). Tenant-wide permission changes still PATCH
shared; user grants are separate. The Harness adapter maps grants API calls and drops tenant grants from the collaborator list so they are not duplicated in the UI.Analytics events were added for permission changes, invites, and removals. Coverage includes dialog, hooks, and adapter tests.
Reviewed by Cursor Bugbot for commit c025b8a. Bugbot is set up for automated code reviews on this repo. Configure here.