Skip to content

Fix time units for participant joinedAt and CallUser created and updated dates - #1891

Merged
gpunto merged 1 commit into
developfrom
fix/and-1709-date-time-units
Oct 22, 2026
Merged

gpunto merged 1 commit into
developfrom
fix/and-1709-date-time-units

Conversation

@gpunto

@gpunto gpunto commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Closes AND-1709

Two places mixed up seconds and milliseconds, and both have shipped in every release:

  • ParticipantState.joinedAt read the SFU joined_at milliseconds as seconds, which put it around year 58,000.
  • CallUser.createdAt / updatedAt passed seconds to Date(millis), which put them in January 1970.

Implementation

  • ParticipantState.updateFromParticipantInfo() builds joinedAt from joined_at's seconds and nanos, and falls back to the current UTC time.
  • MemberResponse.toCallUser() builds each Date from epoch milliseconds.

Testing

  • New ParticipantStateJoinedAtTest and MemberResponseToCallUserTest. They fail without the fix (+58777-01-14T02:22:03Z, and 1792656930 instead of 1792656930123) and pass with it.
  • :stream-video-android-core:testDebugUnitTest spotlessCheck apiCheck passes.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected timestamp conversion to preserve provided date and time values, including sub-millisecond precision.
    • Missing join timestamps now fall back to the current UTC time.

@gpunto gpunto added the pr:bug Fixes a bug label Oct 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 12.39 MB 12.39 MB 0.00 MB 🟢
stream-video-android-ui-xml 5.64 MB 5.64 MB 0.00 MB 🟢
stream-video-android-ui-compose 6.19 MB 6.19 MB 0.00 MB 🟢

@sonarqubecloud

Copy link
Copy Markdown

@gpunto
gpunto marked this pull request as ready for review October 22, 2026 09:21
@gpunto
gpunto requested a review from a team as a code owner October 22, 2026 09:21
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The changes update two timestamp conversions. ParticipantState.updateFromParticipantInfo preserves the nanosecond precision of joined_at and uses the current UTC time when it is absent. MemberResponse.toCallUser() converts createdAt and updatedAt to Date values using epoch milliseconds. Tests cover both conversions.

Suggested reviewers: aleksandar-apostolov

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 553ea

The timestamp fixes appear ready to merge after normal checks; no material current-head risk was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: correcting time-unit handling for participant joinedAt and CallUser dates.
Description check Passed The description includes the goal, implementation, and testing sections. It links the issue and reports relevant tests. The template checklist section is omitted, but the description is otherwise comp…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the goal, implementation, and testing sections. It links the issue and reports relevant tests. The template checklist section is omitted, but the description is otherwise complete and directly related to the changes.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

A rabbit checks the clock at dawn,
Join-time seconds carry nanos on.
UTC keeps the moments bright,
Member dates now land right.
The rabbit hops through time till night.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔇 Additional comments: 5
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ParticipantState.kt: 2

232-236: LGTM!


237-237: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Inject a time source for the missing-timestamp fallback.

When joined_at is absent, OffsetDateTime.now(ZoneOffset.UTC) makes the fallback depend on the system clock. The fallback test can only check a time range, not an exact result. Use an injected clock or current-time argument so the test can assert a fixed instant.

Based on learnings: “Flag direct static/global current-time calls … unless it uses an accepted alternative: an injected TimeProvider/Clock; a current-time argument; a test-controlled ambient clock or time-source override.”

Source: Learnings

stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ParticipantStateJoinedAtTest.kt: 1

34-47: LGTM!

Also applies to: 49-59

stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DomainUtils.kt: 1

55-56: LGTM!

stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/utils/MemberResponseToCallUserTest.kt: 1

27-47: LGTM!


ℹ️ Review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 44c417a9-20c5-4309-b8a4-618997599ed6
📥 Commits

Reviewing files that changed from the base of the PR and between 9364b68 and 553ea17.

📒 Files selected for processing: 4
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ParticipantState.kt
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DomainUtils.kt
  • stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ParticipantStateJoinedAtTest.kt
  • stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/utils/MemberResponseToCallUserTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@PratimMallick PratimMallick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gpunto
gpunto added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 22, 2026
@gpunto
gpunto added this pull request to the merge queue Oct 22, 2026
Merged via the queue into develop with commit 619962b Oct 22, 2026
18 of 19 checks passed
@gpunto
gpunto deleted the fix/and-1709-date-time-units branch October 22, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bug Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants