Skip to content

Conversation

@mmathieum
Copy link
Member

@mmathieum mmathieum self-assigned this Feb 6, 2026
@mmathieum mmathieum linked an issue Feb 6, 2026 that may be closed by this pull request
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Trip ID Integration: Introduced a tripIds field into POIManager, RouteDirectionManager, and RouteManager to enable the association and filtering of service updates based on specific trip identifiers.
  • Service Update Filtering Enhancement: Modified the ServiceUpdateProviderContract.Filter to accept tripIds, allowing service updates to be queried and retrieved with greater precision, linked directly to relevant trips.
  • Code Style and Linting Improvements: Applied minor code style changes, such as adding the final keyword to local variables in Java files and removing unnecessary @Suppress annotations in Kotlin files, enhancing code readability and maintainability.
Changelog
  • app-android/src/main/java/org/mtransit/android/data/DataSourceManager.java
    • Added final keyword to serviceUpdateFilterJSONString, uri, and result local variables for immutability.
  • app-android/src/main/java/org/mtransit/android/data/POIManager.java
    • Added a new private field tripIds of type Collection<String> to store associated trip identifiers.
    • Introduced setTripIds and getTripIds methods to manage the new tripIds field.
    • Modified the ServiceUpdateProviderContract.Filter constructor call to pass the tripIds when requesting service updates.
    • Refactored the placement of the setStatusLoaderListener method within the class.
  • app-android/src/main/java/org/mtransit/android/data/RouteDirectionManager.kt
    • Added a tripIds parameter to the primary constructor of the RouteDirectionManager data class.
    • Updated the ServiceUpdateProviderContract.Filter constructor call to include the new tripIds parameter.
    • Modified the toRouteDirectionM extension function to accept an optional tripIds parameter.
  • app-android/src/main/java/org/mtransit/android/data/RouteManager.kt
    • Added a tripIds parameter to the primary constructor of the RouteManager data class.
    • Updated the ServiceUpdateProviderContract.Filter constructor call to include the new tripIds parameter.
    • Modified the toRouteM extension function to accept an optional tripIds parameter.
  • app-android/src/main/java/org/mtransit/android/task/ServiceUpdateLoader.java
    • Added @SuppressWarnings("unused") annotation to the getTaskCount() method.
  • app-android/src/main/java/org/mtransit/android/ui/view/poi/serviceupdate/POIServiceUpdateViewHolder.kt
    • Removed the @Suppress("MemberVisibilityCanBePrivate") annotation from the fetch method.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@mmathieum
Copy link
Member Author

/gemini review

@mmathieum mmathieum requested a review from Copilot February 9, 2026 18:37
Copy link

Copilot AI left a 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 tripIds into RouteManager, RouteDirectionManager, and POIManager service 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 new findRDSTrips(...) 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.

@mmathieum
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@mmathieum mmathieum marked this pull request as ready for review February 9, 2026 19:24
@mmathieum mmathieum merged commit f5d062c into master Feb 9, 2026
6 checks passed
@mmathieum mmathieum deleted the mm/alerts_w_trip_ids branch February 9, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GTFS-RT service alerts compat w/ trip ID

1 participant