Repository navigation
feat(collaboration): persist activity/notification history and add invitation list+respond endpoints #16460
Copy link
Copy link
Closed
feat(collaboration): persist activity/notification history and add invitation list+respond endpoints#16460
1 / 11 of 1 issue completed
Copy link
Labels
Milestone
Description
Activity
- addedenhancementNew feature or requestNew feature or request
on Sep 12, 2026 - added a commit that references this issue
on Sep 12, 2026 - added a commit that references this issue
on Sep 12, 2026 - linked a pull request that will close this issuefeat(collaboration): persist activity/notification history, add invitation list+respond endpoints (#16460) #16471
on Sep 12, 2026 - added 14 commits that reference this issue
on Sep 12, 2026 Closure evidence (vehicle 2f, merge 2b5a962)
- AC1 —
CollaborationEventmodel + migrationmigrations/versions/20260912_092_collaboration_events.pypersist both activity (websocket/presence.py::_persist_activity_event) and secret-share (api/collaboration.py::_record_event) events.GET /{session_id}/events(api/collaboration_events.py:74) returns them paginated (limit/beforecursor, newest-first). Frontend calls it on join:useSessionCollaboration.ts::_backfillEvents, invoked atuseSessionCollaboration.ts:380. - AC2 —
GET /invitations/mine(api/collaboration_events.py:143) andPOST /{session_id}/invitations/respond(api/collaboration_events.py:194) wired toSessionCollaboration.add_collaborator/remove_invitation. - AC3 —
useSessionCollaboration.tsexportspendingInvitations(line 120/150/563) andrespondToInvitation(line 140/514/572), backed by the new endpoints viaapiService.
- AC1 —
Problem
#16443 wires the collaboration UI onto real backend surfaces (
api/collaboration.py's REST API +websocket/presence.py's presence WebSocket), but two capabilities have no persistence or listing surface at all — accepted as live-only for #16443's first pass, tracked here as the fast-follow.Activity feed and secret-share notifications are ephemeral. impl gap: wire in the real-time collaborative-session UI (#608 phases 5-7 / #874) — 6 components + useSessionCollaboration, zero callers #16443 delivers both over the presence WebSocket's existing generic
{"type": "broadcast", ...}relay (websocket/presence.py'sPresenceManager.broadcast_to_session). That relay only reaches clients connected at the moment of the broadcast — nothing is written to a database. A user who reconnects, or wasn't connected when an activity happened or a secret was shared with them, sees nothing: no history, no "you missed 3 notifications while away."There is no REST endpoint to list or respond to a pending invitation.
models/session_collaboration.py'sSessionCollaborationmodel already supports this (invitations: Mapped[dict],add_invitation(),remove_invitation()), andapi/collaboration.pyexposesPOST /{session_id}/invite(the owner's send side), but there is noGET /{session_id}/invitations(list mine) orPOST /{session_id}/invitations/{id}/respond(accept/decline) endpoint. impl gap: wire in the real-time collaborative-session UI (#608 phases 5-7 / #874) — 6 components + useSessionCollaboration, zero callers #16443 therefore dropspendingInvitations/respondToInvitationfromuseSessionCollaboration.ts's public surface rather than shipping a fake stub — an invited user has no way to see or act on an invitation today, in any client.Fix
SessionCollaboration.collaboration_metadata's JSONB) for activity events and secret-share notifications, plus aGET /{session_id}/activityand/orGET /{session_id}/notificationsendpoint with pagination, so a reconnecting client can backfill.GET /{session_id}/invitations(current user's pending invitations across sessions, or scoped to one session) andPOST /{session_id}/invitations/{invitation_id}/respond(accept/decline), wired to the model's existingadd_invitation/remove_invitationmethods.pendingInvitations/respondToInvitationtouseSessionCollaboration.tsbacked by the real endpoints.Acceptance criteria
useSessionCollaboration.tsrestorespendingInvitations/respondToInvitationbacked by the new endpointsDiscovered During
#16443 (wiring the collaboration UI onto the real backend).