Repository navigation
fix: 站牌經過路線 lists routes from other cities - #119
steventeng2022 wants to merge 2 commits into
Conversation
…#113) The 站牌經過路線 sheet only searched the current route's city, so routes from other cities serving the same stop were missing. Search all cities (local DB where ready, API otherwise) and merge as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Av1anJay
left a comment
There was a problem hiding this comment.
Hermes Agent Review
Verdict: Changes Requested
This review covers the complete two-file diff at commit a7dd407167e0fcc645924367b68eb8c13355194d. CI Verify ran flutter analyze, flutter test (554 tests passed), and the Chrome route-geometry test (2 tests passed). Android and iOS build jobs succeeded. The Windows job failed while Chocolatey returned HTTP 503 fetching the external NSIS package; that is an environment/dependency failure, not evidence about this diff. The findings below are static, source-reachable paths.
🔴 High — native lookup omits intercity routes
BusProvider.inter is deliberately non-local (supportsLocalDatabase == false), but this loop skips every such provider instead of adding it to remoteProviders. The existing native search-provider list includes BusProvider.inter, and the repository maps it to the API city InterCity. On Android/desktop, opening related routes for a city stop can therefore never include an intercity route serving the same stop. Include non-local providers that should be searched remotely (at least BusProvider.inter) in the API scope.
⚠️ Medium — equivalent 臺/台 stop names are filtered out
The repository search normalizes 臺 to 台, but _normalizeStopRouteLookupName only lowercases and removes whitespace. If the current route has 臺北車站 and a sibling provider returns 台北車站, the new cross-provider query can find that result and then the caller drops it at the equality filter. Use the same stop-name normalization contract at this boundary.
✅ Checked
- API city scoping, empty-query behavior, exception isolation, passby validation/fallback, and passby/local deduplication were traced.
- No prior reviews, inline comments, author replies, or prior findings exist for this head.
These are source-derived findings; no local Flutter SDK was available for an independent execution. No claim is made that this review proves zero remaining bugs.
| ]; | ||
| final remoteProviders = <BusProvider>[]; | ||
| for (final provider in BusProvider.values) { | ||
| if (provider == current || !provider.supportsLocalDatabase) continue; |
There was a problem hiding this comment.
🔴 High: The native all-provider loop excludes BusProvider.inter because supportsLocalDatabase is false, and therefore never adds it to remoteProviders. The existing native searchProviders includes BusProvider.inter, and the repository maps it to the InterCity API city. A native related-stop lookup consequently cannot return intercity routes. Add the intended non-local providers to the remote API scope.
| StackTrace? localStackTrace; | ||
| try { | ||
| final results = await controller.searchRoutesByStop( | ||
| final results = await controller.searchRoutesByStopAcrossAllProviders( |
There was a problem hiding this comment.
臺 to 台, but _normalizeStopRouteLookupName only lowercases and removes whitespace. A sibling result named 台北車站 can be returned for a current stop named 臺北車站, then discarded by this equality filter. Reuse the repository’s stop-name normalization contract here.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the review — both points are addressed in f3967f5:
Not run locally (no Flutter in my environment); relying on CI for analyze/tests. 🤖 Generated with Claude Code |
Av1anJay
left a comment
There was a problem hiding this comment.
Hermes Agent Review
Verdict: Approved
已重新檢查 exact head f3967f5be35c66e20d1d963b46cf41d026355dee 的完整兩檔 diff、前次 review 與獨立 adversarial pass。前次 review 的兩項問題均已修正:
BusProvider.inter現在納入remoteProviders,native related-stop lookup 可進入InterCityAPI scope;非目前 provider 的失敗仍被隔離。- UI stop-name filter 現在將
臺fold 為台,與 repository/API query normalization 一致。
同時核對了空查詢、目前 provider 錯誤、其他 provider/API 錯誤、passby/local merge 與 routeId:pathId 去重。未另發現由此 exact head 引入的 blocking defect;未改變的 InterCity action gate 屬於前一版本行為,不列為本 PR finding。
Exact-head CI Verify 成功執行 flutter analyze、554 個 Flutter 測試及 2 個 Chrome 測試;Android、Wear OS、Web、Windows、Linux、macOS 與 unsigned iOS builds 均成功。此次未在本機執行 Flutter;此 review 不宣稱已證明零剩餘問題。
Fixes #113.
The related-stop-routes sheet only looked up routes in the current route's city, so routes managed by other cities but stopping at the same stop were omitted.
AppController.searchRoutesByStopAcrossAllProviders: searches the current city first (errors propagate as before), then every other city — local DB when downloaded, otherwise one API call. Failures in other cities are skipped.route_detail_screenuses it for the local name lookup; the existing name filter and passby merge are unchanged. Entries from other cities already open with their own provider.Not verified: Flutter isn't installed in my environment, so I did not run
flutter analyzeor the tests, and added no new test. Please run CI.🤖 Generated with Claude Code