Repository navigation
Schedule.Timestamp KT ext - #191
Conversation
mmathieum
commented
Jul 30, 2026
- Schedule screen > add buttton to hide real-time" info mtransit-for-android#399
PR Summary by QodoAdd Schedule.Timestamp helpers to hide real-time times/diffs
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe timestamp diff model is renamed from arrival diff to departure-arrival diff across Schedule.Timestamp accessors, JSON persistence, GTFS stop-time parsing, real-time delay calculations, and related tests. ChangesSchedule departure-arrival diff
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GTFSStatusProvider
participant ScheduleTimestamp
participant GTFSRealTimeTripUpdatesProvider
GTFSStatusProvider->>ScheduleTimestamp: parse departure-arrival diff
GTFSRealTimeTripUpdatesProvider->>ScheduleTimestamp: read departureArrivalDiff
GTFSRealTimeTripUpdatesProvider->>GTFSRealTimeTripUpdatesProvider: apply delay using diff
ScheduleTimestamp->>ScheduleTimestamp: derive arrival timestamp
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/java/org/mtransit/android/commons/data/ScheduleExt.kt (1)
125-129: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for both
hideRealTimebranches.The existing tests cover original
Instantderivation, but notdepartureMs(hideRealTime)orarrivalMs(hideRealTime). Add assertions for bothtrueandfalseafter a real-time update.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/org/mtransit/android/commons/data/ScheduleExt.kt` around lines 125 - 129, Add test coverage for Schedule.Timestamp.departureMs and arrivalMs after a real-time update, asserting the original millisecond values when hideRealTime is true and the updated real-time values when it is false. Extend the existing original Instant derivation test or its surrounding test fixture without changing the production extensions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/org/mtransit/android/commons/data/ScheduleExt.kt`:
- Around line 172-175: Update Schedule.Timestamp.originalArrivalDiffMs so the
original arrival difference is clamped consistently with arrivalDiff, preventing
negative values when originalArrivalMs exceeds originalDepartureMs. Preserve
getArrivalDiff’s existing hideRealTime selection while ensuring both branches
return the same non-negative duration contract.
---
Nitpick comments:
In `@src/main/java/org/mtransit/android/commons/data/ScheduleExt.kt`:
- Around line 125-129: Add test coverage for Schedule.Timestamp.departureMs and
arrivalMs after a real-time update, asserting the original millisecond values
when hideRealTime is true and the updated real-time values when it is false.
Extend the existing original Instant derivation test or its surrounding test
fixture without changing the production extensions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0e52c675-7c29-451b-a801-2bea1373f4d3
📒 Files selected for processing (1)
src/main/java/org/mtransit/android/commons/data/ScheduleExt.kt
left a comment
There was a problem hiding this comment.
🟡 Not ready to approve
A newly introduced “original arrival diff” path can return negative durations (unlike the existing clamped arrivalDiff), which can lead to inconsistent behavior when hideRealTime=true.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds Kotlin extension helpers on Schedule.Timestamp to work with “original” (non-real-time) vs real-time values, including millisecond-based accessors and diff utilities, likely to support a “hide real-time” display/logic mode consistently across the app.
Changes:
- Added
departureMs(hideRealTime)/arrivalMs(hideRealTime)helpers to return either original or real-time timestamps in milliseconds. - Introduced
originalDepartureMs/originalArrivalMsand refactoredoriginalDeparture/originalArrivalto derive from those ms values. - Added
originalArrivalDiff*extensions plusgetArrivalDiff(hideRealTime)to mirror existingarrivalDiffbehavior.
File summaries
| File | Description |
|---|---|
| src/main/java/org/mtransit/android/commons/data/ScheduleExt.kt | Adds ms-based timestamp helpers and “original vs real-time” diff utilities for Schedule.Timestamp. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Code Review by Qodo
1.
|
left a comment
There was a problem hiding this comment.
🟡 Not ready to approve
ScheduleExt.kt currently accesses a protected Java member for departureArrivalDiff, which will not compile from the Kotlin extension as written.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.