Fix/group pomodoro creator controls#1006
Conversation
|
@Tamcodes4 is attempting to deploy a commit to the durdana3105's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough
ChangesGroupPomodoro Creator Authorization and Duration Clamping
MarkdownRenderer Sanitization Refactor
Sequence Diagram(s)sequenceDiagram
participant Room
participant GroupPomodoro
participant useAuth
participant Supabase
Room->>GroupPomodoro: roomId, creatorId={room.created_by}
GroupPomodoro->>useAuth: get current user
useAuth-->>GroupPomodoro: user.id
GroupPomodoro->>GroupPomodoro: isCreator = user.id === creatorId
alt isCreator
GroupPomodoro->>GroupPomodoro: clampDurations(workDuration, breakDuration)
GroupPomodoro->>Supabase: update timer_state, timer_end_time, clamped durations
Supabase-->>GroupPomodoro: broadcast UPDATE to all participants
else not creator
GroupPomodoro->>GroupPomodoro: render read-only timer view
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Closes #934
Summary
Fixes an issue where any participant in a study room could start, stop, or reset the shared Group Pomodoro timer.
Changes
Security
The existing study_rooms RLS policies continue to enforce creator-only updates at the database level.
Summary by CodeRabbit
New Features
Improvements