Repository navigation
Fix time units for participant joinedAt and CallUser created and updated dates - #1891
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🔇 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_atis 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
📒 Files selected for processing: 4
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ParticipantState.ktstream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DomainUtils.ktstream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ParticipantStateJoinedAtTest.ktstream-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.



Goal
Closes AND-1709
Two places mixed up seconds and milliseconds, and both have shipped in every release:
ParticipantState.joinedAtread the SFUjoined_atmilliseconds as seconds, which put it around year 58,000.CallUser.createdAt/updatedAtpassed seconds toDate(millis), which put them in January 1970.Implementation
ParticipantState.updateFromParticipantInfo()buildsjoinedAtfromjoined_at's seconds and nanos, and falls back to the current UTC time.MemberResponse.toCallUser()builds eachDatefrom epoch milliseconds.Testing
ParticipantStateJoinedAtTestandMemberResponseToCallUserTest. They fail without the fix (+58777-01-14T02:22:03Z, and1792656930instead of1792656930123) and pass with it.:stream-video-android-core:testDebugUnitTest spotlessCheck apiCheckpasses.Summary by CodeRabbit