Repository navigation
Session availibilty toast - #1366
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughA locale string was revised. A debug log was added to user detail retrieval. Session request acceptance now sets a sessionCreatedByRequest flag. Session creation logic allows mutable error message and, when the flag is present, returns a different error key for time-slot conflicts. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as Requester
participant UI as Client/UI
participant RS as requestSessions.accept()
participant SS as sessions.create()
participant TV as Time-slot Validator
User->>UI: Accept session request
UI->>RS: accept(requestId)
RS->>SS: createSession({..., sessionCreatedByRequest: true})
SS->>TV: validate(timeSlot, mentor, user)
alt Slot unavailable
TV-->>SS: conflict
SS->>SS: if sessionCreatedByRequest => set errorKey = INVALID_TIME_SELECTION_FOR_GIVEN_MENTOR
SS-->>RS: throw error(errorKey)
RS-->>UI: surface errorKey
UI-->>User: Show localized message
else Slot available
TV-->>SS: ok
SS-->>RS: session created
RS-->>UI: success
UI-->>User: Confirmation
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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 |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/services/requestSessions.js (1)
342-343: Drop the extra boolean passed to sessionService.createThe signature is create(bodyData, loggedInUserId, orgId, isAMentor, notifyUser) (src/services/sessions.js:67) but the call passes six args (src/services/requestSessions.js:346). Remove the trailing boolean (the second
true) to match the signature and avoid confusion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/locales/en.json(1 hunks)src/requests/user.js(1 hunks)src/services/requestSessions.js(1 hunks)src/services/sessions.js(2 hunks)
🔇 Additional comments (2)
src/locales/en.json (1)
140-140: LGTM — clearer conflict message.The revised copy is concise and user-friendly.
src/services/sessions.js (1)
163-170: LGTM — targeted error override for request-created sessions.The conditional switch to INVALID_TIME_SELECTION_FOR_GIVEN_MENTOR is appropriate and keeps non-request flows unchanged.
Summary by CodeRabbit