Description of the Bug
The workspace invitation system has two related bugs that make it non-functional:
Bug 1: WorkspaceInvitation model uses workspace_name instead of workspace_id
In backend/app/models.py, the WorkspaceInvitation model stores workspace_name: str rather than a workspace_id foreign key. When an invitation is accepted, there is no way to reliably look up the actual workspace because:
- The workspace could have been renamed since the invitation was created
- The workspace could have been deleted
- Multiple workspaces could share the same name
- There is no database constraint enforcing referential integrity
Bug 2: accept_invitation endpoint does not exist
Looking at backend/app/routes/workspaces.py and the FastAPI router includes in main.py, there is no accept_invitation endpoint. Even if invitations could be sent (see Bug #736), there is no way for the invited user to accept them. The invitation feature is half-implemented - it supports creating invitations but not consuming them.
Steps to Reproduce
- As a user, receive a workspace invitation link (however it's delivered)
- There is no API endpoint to accept the invitation
- The invitation feature is non-functional end-to-end
Expected Behavior
WorkspaceInvitation model should have a workspace_id foreign key pointing to the Workspace table
- There must be a
POST /api/v1/workspaces/invitations/{invitation_id}/accept endpoint
- Accepting an invitation should add the user as a member of the workspace
Affected Files
backend/app/models.py (WorkspaceInvitation model)
backend/app/routes/workspaces.py (missing accept_invitation endpoint)
Suggested Fix
- Add
workspace_id: Mapped[str] = mapped_column(ForeignKey("workspaces.id")) to WorkspaceInvitation
- Implement an acceptance endpoint that validates the invitation token, finds the workspace, creates a
WorkspaceMember record, and marks the invitation as accepted
GSSoC '26
Description of the Bug
The workspace invitation system has two related bugs that make it non-functional:
Bug 1: WorkspaceInvitation model uses workspace_name instead of workspace_id
In
backend/app/models.py, theWorkspaceInvitationmodel storesworkspace_name: strrather than aworkspace_idforeign key. When an invitation is accepted, there is no way to reliably look up the actual workspace because:Bug 2: accept_invitation endpoint does not exist
Looking at
backend/app/routes/workspaces.pyand the FastAPI router includes inmain.py, there is noaccept_invitationendpoint. Even if invitations could be sent (see Bug #736), there is no way for the invited user to accept them. The invitation feature is half-implemented - it supports creating invitations but not consuming them.Steps to Reproduce
Expected Behavior
WorkspaceInvitationmodel should have aworkspace_idforeign key pointing to theWorkspacetablePOST /api/v1/workspaces/invitations/{invitation_id}/acceptendpointAffected Files
backend/app/models.py(WorkspaceInvitation model)backend/app/routes/workspaces.py(missing accept_invitation endpoint)Suggested Fix
workspace_id: Mapped[str] = mapped_column(ForeignKey("workspaces.id"))toWorkspaceInvitationWorkspaceMemberrecord, and marks the invitation as acceptedGSSoC '26