-
Notifications
You must be signed in to change notification settings - Fork 4
Service updates/alerts compat w/ trip IDs #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mmathieum
commented
Feb 6, 2026
- Service updates/alerts compat w/ trip IDs commons-android#55
Summary of ChangesHello @mmathieum, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the service update and alert system by introducing compatibility with trip IDs. By integrating trip identifiers into core data management classes and the service update filtering mechanism, the application can now provide more granular and contextually relevant service information. This change allows for more precise targeting of alerts, ensuring users receive information directly pertinent to their specific transit trips. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully integrates trip IDs into the service update and alert fetching mechanism. The changes are consistently applied across POIManager, RouteDirectionManager, and RouteManager by adding a tripIds collection and passing it to the ServiceUpdateProviderContract.Filter. The implementation looks solid. I have one minor suggestion to improve encapsulation in POIServiceUpdateViewHolder.
...d/src/main/java/org/mtransit/android/ui/view/poi/serviceupdate/POIServiceUpdateViewHolder.kt
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds trip-ID awareness to service updates/alerts flows so loaders/filters can target more precise entities (route/direction/POI) when trip IDs are available.
Changes:
- Plumbs
tripIdsintoRouteManager,RouteDirectionManager, andPOIManagerservice update filters. - Introduces trip-ID loading in multiple ViewModels (gated by feature flags) and passes trip IDs into manager constructors.
- Refactors service update retrieval APIs to return
List<ServiceUpdate>and adds a newfindRDSTrips(...)request path.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| app-android/src/main/java/org/mtransit/android/ui/view/poi/serviceupdate/POIServiceUpdateViewHolder.kt | Removes an unnecessary visibility suppression annotation. |
| app-android/src/main/java/org/mtransit/android/ui/type/rds/RDSAgencyRoutesViewModel.kt | Loads per-route trip IDs (flag gated) and passes them into RouteManager. |
| app-android/src/main/java/org/mtransit/android/ui/serviceupdates/ServiceUpdatesViewModel.kt | Loads trip IDs (flag gated) and passes them into route/direction managers for service updates. |
| app-android/src/main/java/org/mtransit/android/ui/rds/route/direction/RDSDirectionStopsViewModel.kt | Updates trip-ID fetching logic and ensures vehicle locations and service updates can use trip IDs. |
| app-android/src/main/java/org/mtransit/android/ui/rds/route/RDSRouteViewModel.kt | Loads trip IDs for a route (flag gated) and passes them into RouteManager. |
| app-android/src/main/java/org/mtransit/android/ui/fragment/POIViewModel.kt | Updates POI trip-ID fetching and vehicle-location gating based on provider trip-ID support. |
| app-android/src/main/java/org/mtransit/android/task/ServiceUpdateLoader.java | Switches internal async result types from ArrayList to List. |
| app-android/src/main/java/org/mtransit/android/datasource/POIRepository.kt | Preserves POI “extras” (trip IDs, status, service updates) when refreshing cached POIs. |
| app-android/src/main/java/org/mtransit/android/datasource/DataSourceRequestManager.kt | Adds findRDSTrips(...) (discouraged) wrapper and reformats vehicle location request call. |
| app-android/src/main/java/org/mtransit/android/data/RouteManager.kt | Adds tripIds to service update filter + updates toRouteM signature. |
| app-android/src/main/java/org/mtransit/android/data/RouteDirectionManager.kt | Adds tripIds to service update filter + updates toRouteDirectionM signature. |
| app-android/src/main/java/org/mtransit/android/data/POIManagerExt.kt | Extends toPOIM to restore trip IDs/status/service updates onto new POIManager. |
| app-android/src/main/java/org/mtransit/android/data/POIManager.java | Stores trip IDs, exposes current service updates via getter, and uses trip IDs in service update filter. |
| app-android/src/main/java/org/mtransit/android/data/DataSourceManager.java | Returns List<ServiceUpdate>, adds findRDSTrips(...) with optional direction, and refactors selection building. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app-android/src/main/java/org/mtransit/android/ui/type/rds/RDSAgencyRoutesViewModel.kt
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/ui/type/rds/RDSAgencyRoutesViewModel.kt
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/datasource/DataSourceRequestManager.kt
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/data/DataSourceManager.java
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/data/POIManagerExt.kt
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/data/POIManager.java
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/data/POIManager.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a series of valuable refactorings and improvements across the codebase. Key changes include consistently programming to the List interface instead of the ArrayList implementation, which enhances flexibility. A significant architectural improvement is the refactoring of how trip IDs are handled for vehicle locations, simplifying ViewModels and centralizing logic within data providers. The changes also include several cleanups, such as removing unused dependencies and applying more idiomatic Kotlin syntax. Additionally, a subtle but important bug in the POIManager.hashCode() method has been corrected. Overall, these changes improve code quality, maintainability, and correctness.