-
Notifications
You must be signed in to change notification settings - Fork 4
chore: fix group issue #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Caution Review failedThe pull request is closed. WalkthroughInternal data-fetching logic was refactored in two services and a controller: PollService now derives user group memberships via direct group queries; AuthController’s login path calls a stricter UserService method that no longer auto-creates users and returns 404 when absent; UserService implements multi-step ename lookup and token issuance. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor C as Client
participant A as AuthController
participant U as UserService
participant R as UserRepository
participant T as TokenSigner
C->>A: POST /login { ename }
A->>U: findUserByEname(ename)
rect rgba(200,230,255,0.3)
note over U: Multi-step lookup
U->>R: findByEname(ename)
alt not found AND ename starts with "@"
U->>R: findByEname(ename without "@")
else not found AND ename lacks "@"
U->>R: findByEname("@" + ename)
end
end
alt user found
U->>T: signToken(user)
T-->>U: token
U-->>A: { user, token }
A-->>C: 200 OK { user, token }
else user not found
U-->>A: throws "not found"
A-->>C: 404 Not Found { error, message, details }
end
sequenceDiagram
autonumber
actor C as Client
participant P as PollService
participant G as GroupRepository
participant PR as PollRepository
C->>P: getAllPolls(userId)
rect rgba(230,255,230,0.4)
P->>G: query groups where userId in members/admins/participants (left joins)
G-->>P: groups[]
P->>P: derive userGroupIds from groups
end
P->>PR: query polls (public OR in userGroupIds OR createdBy userId)
PR-->>P: polls[]
P-->>C: polls[]
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (3)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Description of change
Issue Number
Type of change
How the change has been tested
Change checklist
Summary by CodeRabbit
Bug Fixes
Refactor
Chores