fix: only negative transfer time as an "uncertain transfer" - #66
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The behavior change is small, consistent with the stated intent, and is covered by updated and new tests (only minor doc wording nits remain).
Pull request overview
Adjusts transfer-risk classification so only negative transfer gaps are flagged as “uncertain”, aligning behavior with Entur trip planner semantics where a 0s transfer can be considered feasible.
Changes:
- Update
getTransferRiskto returnundefinedforseconds >= 0(only< 0is “uncertain”). - Refresh docs to match the updated interpretation of “risky” transfers.
- Update and extend unit tests to cover the 0-second transfer behavior at both function and leg levels.
File summaries
| File | Description |
|---|---|
| src/transfer-risk/types.ts | Updates TransferRisk documentation wording. |
| src/transfer-risk/transfer-risk.ts | Changes risk classification to only flag negative gaps; updates related JSDoc. |
| src/transfer-risk/tests/transfer-risk.test.ts | Updates existing tests and adds coverage for zero-gap leg transfers. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adjusted to below zero only, due to 0s transfer time can be considered as a valid trip by Entur
See reference https://mittatb.slack.com/archives/C09CJU3JUH5/p1788553292396239