Fix scheduledDistanceAlongTrip when scheduleDeviation is zero - #1283
Fix scheduledDistanceAlongTrip when scheduleDeviation is zero#1283Ahmedhossamdev wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesTrip status distance calculation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
|
Performance Smoke Test ResultsStatus: PASSED
Smoke test config: 5 VUs x 30s. Thresholds: p(95) < 300ms, error rate < 1%. Full results uploaded as workflow artifact: k6-smoke-summary. |



Fixes: #1282
Summary
This PR fixes the computation of
scheduledDistanceAlongTripfor on-time vehicles.Previously, the value was only calculated when
scheduleDeviation != 0, causing vehicles with no schedule deviation to incorrectly report:instead of a value equal to
distanceAlongTrip.This behavior differs from the Java reference implementation, which reports:
whenever
scheduleDeviation == 0.Changes
scheduleDeviation != 0guard when computingscheduledDistanceAlongTrip.scheduledDistanceAlongTripequal todistanceAlongTrip.Result
scheduledDistanceAlongTripnow matches the Java implementation and the API specification for both delayed/early and on-time vehicles.Summary by CodeRabbit