fix: room join from another team#319
Conversation
✅ Deploy Preview for hoppdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThis PR refactors room access authorization from team relation comparison to direct TeamID pointer equality checking, updating the error response from ChangesRoom Access Authorization and Error Handling
Sequence DiagramsequenceDiagram
participant User as User
participant RoomComponent as Room Component
participant RoomJoinError as RoomJoinError
participant Dashboard as Dashboard
User->>RoomComponent: Join room with token/server URL
RoomComponent->>RoomComponent: Fetch room data
RoomComponent-->>RoomComponent: Error (402/403/404)
RoomComponent->>RoomJoinError: Pass error object
RoomJoinError->>RoomJoinError: Check error.response.status
alt Status 403
RoomJoinError-->>User: Team membership error
else Status 404
RoomJoinError-->>User: Room not found
else Status 402
RoomJoinError-->>User: Trial/subscription expired
else Generic
RoomJoinError-->>User: Unable to join room
end
User->>Dashboard: Click Go to Dashboard
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web-app/src/pages/Room.tsx`:
- Around line 128-130: The current conditional in Room.tsx that shows "You don't
have access..." when error is truthy is misleading for non-auth issues; update
the message logic in the render (the <p> that reads the error variable) to use a
neutral fallback like "Unable to join the room. Please try again or contact
support." while still surfacing specific error details when available (e.g.,
check error.message or a specific status field on the error object) so the UI
does not imply access denial for network/server errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 42481ea4-f083-4d35-9f37-c992ed523fd5
📒 Files selected for processing (5)
backend/api-files/openapi.yamlbackend/internal/handlers/handlers.gotauri/src/openapi.d.tsweb-app/src/openapi.d.tsweb-app/src/pages/Room.tsx
Fix the broken user-flow where users join from a newly created team, if they are invited from another team.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation