Skip to content

Conversation

hiroshihorie
Copy link
Member

The timestamp() constructor uses now() + UTC.

Copy link

@Copilot 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 updates timestamp generation throughout the codebase to use UTC timestamps instead of local time. The change replaces DateTime.now() with DateTime.timestamp() to ensure consistent UTC-based time handling across the application.

Key changes:

  • Replaced all instances of DateTime.now() with DateTime.timestamp() for UTC consistency
  • Updated import statements to be more specific by using show clauses
  • Modified one instance to reuse an already computed timestamp value instead of creating a new one

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web/e2ee.sfi_guard.dart Updated SIF frame timing calculations to use UTC timestamps
lib/src/support/region_url_provider.dart Updated region settings cache timing to use UTC timestamps
lib/src/participant/participant.dart Updated participant speaking and join time tracking to use UTC timestamps
lib/src/participant/local.dart Updated data stream timestamps and optimized timestamp reuse
lib/src/core/signal_client.dart Updated ping timestamps to use UTC
lib/src/core/room.dart Updated transcription and data stream timing to use UTC
lib/src/core/engine.dart Updated reconnection timing to use UTC

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -1345,7 +1345,7 @@ extension DataStreamParticipantMethods on LocalParticipant {
streamId: streamId,
topic: options?.topic,
encryptionType: options?.encryptionType,
timestamp: Int64(DateTime.now().millisecondsSinceEpoch),
timestamp: Int64(info.timestamp),
Copy link
Preview

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

This change improves maintainability by reusing the timestamp from info instead of generating a new timestamp with DateTime.timestamp().millisecondsSinceEpoch. This ensures consistency between the timestamp stored in info and the one used in the protocol buffer.

Copilot uses AI. Check for mistakes.

@hiroshihorie hiroshihorie merged commit 7fd949d into main Sep 8, 2025
10 of 11 checks passed
@hiroshihorie hiroshihorie deleted the hiroshi/utc-timestamp branch September 8, 2025 04:56
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.

2 participants