Skip to content

store and calculate both server and client side breakout timestamps in UTC#318

Open
karenunify wants to merge 4 commits intoberkmancenter:stagingfrom
karenunify:updated-breakout-room-countdown-fix
Open

store and calculate both server and client side breakout timestamps in UTC#318
karenunify wants to merge 4 commits intoberkmancenter:stagingfrom
karenunify:updated-breakout-room-countdown-fix

Conversation

@karenunify
Copy link
Collaborator

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:

  1. with no intro or buffer
  2. a buffer but no intro
  3. an intro but no buffer
  4. both intro and buffer

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 scheduledTime using 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

  • scheduledTime is floored to the nearest second after adding smartMatchingWaitTime, 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 truncating nowMillis to whole seconds before adding the wait (or rounding scheduledMillis up to the next whole second) so the scheduled time is never earlier than now + 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.

@karenunify karenunify marked this pull request as ready for review March 3, 2026 19:20
@karenunify karenunify requested a review from katherineqian March 3, 2026 19:20
@karenunify karenunify changed the title store and calculate both server and client side timestamps in UTC store and calculate both server and client side breakout timestamps in UTC Mar 3, 2026
BreakoutRoomStatus.pending &&
breakoutRoomRemainingTime >= Duration.zero;
final breakoutsMessage = areBreakoutsPending
breakoutRoomRemainingTime > Duration.zero;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this clarification!

Copy link
Collaborator

@mikewillems mikewillems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@katherineqian katherineqian removed their request for review March 5, 2026 20:49
@karenunify
Copy link
Collaborator Author

@mikewillems done!

@karenunify
Copy link
Collaborator Author

Thanks for the review!

@karenunify karenunify requested a review from mikewillems March 6, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants