Revert case-insensitive stop/route-ID comparisons to exact equality#1923
Merged
Conversation
…1905) #1865 introduced ignoreCase = true at six stop/route-id comparison sites with no documented rationale, and #1908 copied the same pattern into a seventh (HomeViewModel.focusedTrips). CLAUDE.md names fuzzy matching where an exact key exists as a heuristic that needs human sign-off before merge; none exists here, and there's no wire evidence OBA stop/route IDs vary in case. It's also internally inconsistent: RouteMapController.focusStop already dedups stop focus sessions via case-sensitive data-class equality, so a mixed-case ID could pass these gates while defeating that dedup. Revert all seven call sites to exact (==) equality: MapViewModel.showStopRoutes, HomeViewModel (focusedTrips, onStopFocused, onArrivalsLoaded, restoreMapAfterBack), and RouteRowGroup.resolveSelectedRouteGroupKey. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughStop and route identifier comparisons across map, home, arrivals, and route-group state now use case-sensitive equality instead of case-insensitive matching. ChangesIdentity matching
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
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.
Summary
ignoreCase = trueat six stop/route-ID comparison sites with no documented rationale, and Focused-trip data layer: stops-for-route fetched via two paths, shapes double-cached, focusedTrips in three copies #1908 later copied the same pattern into a seventh (HomeViewModel.focusedTrips). CLAUDE.md calls out "fuzzy string matching where an exact key exists" as a heuristic that needs human sign-off before merge; none exists here, and there's no wire evidence that OBA stop/route IDs vary in case.RouteMapController.focusStopalready dedups stop-focus sessions via case-sensitive data-class equality, so a mixed-case ID could pass these gates while defeating that dedup — silent edge-only misbehavior.==) equality:MapViewModel.showStopRoutes,HomeViewModel(focusedTrips,onStopFocused,onArrivalsLoaded,restoreMapAfterBack), andRouteRowGroup.resolveSelectedRouteGroupKey.Fixes #1905
Test plan
./gradlew :onebusaway-android:compileObaGoogleDebugKotlin -PwarningsAsErrors=true— compiles clean./gradlew :onebusaway-android:testObaGoogleDebugUnitTest --tests "org.onebusaway.android.ui.home.HomeViewModelTest" --tests "org.onebusaway.android.map.MapViewModelTest" --tests "org.onebusaway.android.ui.arrivals.*"— all pass (no test depended on case-insensitive matching)🤖 Generated with Claude Code
Summary by CodeRabbit