store and calculate both server and client side breakout timestamps in UTC#318
store and calculate both server and client side breakout timestamps in UTC#318karenunify wants to merge 4 commits intoberkmancenter:stagingfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to fix incorrect breakout-room countdown messaging in hostless meetings by standardizing breakout scheduling/countdown logic around UTC time to avoid timezone-related mismatches.
Changes:
- Updated the server-side breakout initiation logic to compute and store
scheduledTimeusing epoch-milliseconds and UTC. - Updated the client-side breakout countdown to compare times in UTC and to avoid showing a restarted/invalidly-large countdown by switching to a “Generating…” state.
- Adjusted UI logic to show the countdown only when the breakout session is pending and remaining time is strictly positive.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| firebase/functions/lib/events/live_meetings/breakouts/initiate_breakouts.dart | Computes breakout scheduledTime via epoch millis and stores it as UTC. |
| client/lib/features/events/features/live_meeting/presentation/widgets/live_meeting_desktop.dart | Uses UTC for countdown calculations and adds guardrails to prevent erroneous long countdown displays. |
Comments suppressed due to low confidence (1)
firebase/functions/lib/events/live_meetings/breakouts/initiate_breakouts.dart:114
scheduledTimeis floored to the nearest second after addingsmartMatchingWaitTime, which can shorten the intended 30s wait by up to ~999ms (e.g., the client countdown may start at 00:29 instead of 00:30). If the goal is a consistent 30-second countdown, consider truncatingnowMillisto whole seconds before adding the wait (or roundingscheduledMillisup to the next whole second) so the scheduled time is never earlier thannow + smartMatchingWaitTime.
final nowMillis = DateTime.now().millisecondsSinceEpoch;
final scheduledMillis = nowMillis + smartMatchingWaitTime.inMilliseconds;
// Remove milliseconds for cleaner display
final scheduledTime = DateTime.fromMillisecondsSinceEpoch(
(scheduledMillis ~/ 1000) * 1000,
isUtc: true,
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| BreakoutRoomStatus.pending && | ||
| breakoutRoomRemainingTime >= Duration.zero; | ||
| final breakoutsMessage = areBreakoutsPending | ||
| breakoutRoomRemainingTime > Duration.zero; |
There was a problem hiding this comment.
Love this clarification!
mikewillems
left a comment
There was a problem hiding this comment.
Great job! One tiny change then it's ready to go:
data_models/lib/events/live_meetings/live_meeting.g.dart gets regenerated by the builder, so please do a local build then commit that file with the PR.
|
@mikewillems done! |
|
Thanks for the review! |
What is in this PR?
This PR fixes the "Breakout room matching starting in XX:XX" message and prevents the countdown from resetting to an hour once the breakoutRoomRemainingTime countdown reaches 00:00, as it was doing previously.
Changes in the codebase
This converts the storing of hostless meeting breakout logic timestamps on both server and client side to UTC. Now the calculation of breakoutRoomRemainingTime and breakoutRoomScheduledTime countdown logic and display avoids timezone mismatch and erroneous display of remaining time until participants are sent into breakout rooms.
Testing this PR
To test this PR, I created 4 hostless meetings:
In all 4 meeting variations, once the breakoutRoomStatus is in the pending state and the breakoutRoomRemainingTime reaches 0, the breakoutRoomRemainingTime showCountdown should start at 30 seconds consistently, and once it reaches 00:00 should show the "Generating breakout room assignments" breakoutsMessage correctly.