Skip to content

Vehicles locations#44

Merged
mmathieum merged 40 commits into
masterfrom
mm/vehicle
Jan 27, 2026
Merged

Vehicles locations#44
mmathieum merged 40 commits into
masterfrom
mm/vehicle

Conversation

@mmathieum

@mmathieum mmathieum commented Dec 1, 2025

Copy link
Copy Markdown
Member

@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 support for displaying real-time vehicle locations, which is a great new feature. The implementation for GTFS-RT vehicle positions is comprehensive, adding new provider contracts, data models, and the necessary logic for fetching and caching data. The changes are well-structured and follow the existing architecture of the project.

I've identified a couple of critical copy-paste errors in the new code that could lead to incorrect caching behavior and data conflicts between service updates and vehicle locations. Additionally, I've suggested a refactoring to simplify part of the URL handling logic to improve clarity and maintainability. Addressing these points will ensure the new feature is robust and reliable.

Comment thread src/main/java/org/mtransit/android/commons/provider/gtfs/GtfsRealTimeStorage.kt Outdated
@mmathieum mmathieum marked this pull request as ready for review January 19, 2026 21:09
mmathieum added a commit to mtransitapps/ca-laval-stl-bus-android that referenced this pull request Jan 21, 2026
@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 significant new feature: displaying real-time vehicle locations for GTFS-RT and NextBus compatible agencies. The implementation is well-structured, with new provider contracts, helpers, and data models that follow the existing architecture of the project. The refactoring of the Direction data class to include the authority is a good improvement for encapsulation. I've found a couple of issues related to a duplicated field and inconsistent variable usage that should be addressed. Overall, this is a great addition to the app's functionality.

Comment thread src/main/java/org/mtransit/android/commons/provider/NextBusProvider.java Outdated
Comment thread src/main/java/org/mtransit/android/commons/provider/NextBusProvider.java Outdated
Comment thread src/main/java/org/mtransit/android/commons/provider/NextBusProvider.java Outdated
Comment thread src/main/java/org/mtransit/android/commons/provider/NextBusProvider.java Outdated
@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 significant new functionality by adding vehicle location tracking for both GTFS-RT and NextBus providers. The changes are well-structured, leveraging a new Targetable interface to generalize UUID handling across different data models. This improves consistency and maintainability. New data models, provider contracts, and database helpers have been added, and existing code has been refactored to integrate with these new components. The database schema updates and version increments are correctly implemented. Overall, the changes are a robust addition to the codebase.

@mmathieum mmathieum requested a review from Copilot January 23, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements vehicle location tracking functionality for transit providers, adding support for both GTFS-RT and NextBus vehicle position data. The changes enable real-time vehicle tracking by introducing a new provider contract system and integrating it with existing transit data providers.

Changes:

  • Added vehicle location provider infrastructure with database support and caching mechanisms
  • Integrated GTFS-RT and NextBus vehicle positions APIs with appropriate data models and parsers
  • Updated Direction class to include authority field for proper UUID generation across all route/direction references

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/java/org/mtransit/android/commons/provider/vehiclelocations/VehicleLocationProviderContract.kt Defines contract interface for vehicle location providers with filter and query capabilities
src/main/java/org/mtransit/android/commons/provider/vehiclelocations/VehicleLocationProvider.kt Implements core vehicle location provider logic including caching and data retrieval
src/main/java/org/mtransit/android/commons/provider/vehiclelocations/model/VehicleLocation.kt Data model for vehicle location with position, bearing, speed, and timestamp information
src/main/java/org/mtransit/android/commons/provider/vehiclelocations/GTFSRealTimeVehiclePositionsProvider.kt GTFS-RT specific vehicle position parsing and caching implementation
src/main/java/org/mtransit/android/commons/provider/vehiclelocations/NextBusVehicleLocationsProvider.kt NextBus API specific vehicle position parsing and caching implementation
src/main/java/org/mtransit/android/commons/provider/NextBusProvider.java Integrated VehicleLocationProviderContract and added NextBus vehicle location support
src/main/java/org/mtransit/android/commons/provider/GTFSRealTimeProvider.java Integrated VehicleLocationProviderContract and added GTFS-RT vehicle position support
src/main/java/org/mtransit/android/commons/data/Direction.java Added authority field to Direction class for proper UUID generation
src/test/java/org/mtransit/android/commons/provider/Tests. Updated test files to include authority parameter in Direction constructors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mmathieum mmathieum merged commit 8afde62 into master Jan 27, 2026
4 checks passed
@mmathieum mmathieum deleted the mm/vehicle branch January 27, 2026 13:25
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.

2 participants