Skip to content

Expand RTD support and restore RIPTA realtime feeds - #3

Open
jbriones95 wants to merge 3 commits into
CJFData:pico-transitfrom
jbriones95:feature/rtd-ripta-live
Open

Expand RTD support and restore RIPTA realtime feeds#3
jbriones95 wants to merge 3 commits into
CJFData:pico-transitfrom
jbriones95:feature/rtd-ripta-live

Conversation

@jbriones95

Copy link
Copy Markdown

Summary

This replaces closed PR #2 and includes all transit changes since the last accepted RTD PR (#1), plus restored RIPTA live realtime support.

Changes since PR #1

RTD and Bustang

  • Keep RTD Denver static schedule and canonical GTFS-realtime TripUpdate/VehiclePosition feeds.
  • Add Bustang as an additional static feed under RTD Denver.
  • Namespace route, trip, stop, and service IDs across feeds to prevent collisions.

Ingestion reliability

  • Replace delete-in-use database updates with temporary database creation and atomic replacement.
  • Parse ZIP entries with ZipFile streams to avoid ZipInputStream EOF/corruption failures.
  • Serialize ingestion and cancel stale agency-ingestion jobs during agency switching.
  • Track cache metadata per feed and invalidate correctly when a feed changes.

Schedule browsing

  • Support routes with no GTFS direction_id, including Bustang.
  • Allow nullable direction IDs through repository and schedule-selection flows.
  • Auto-advance directionless routes to stop selection.

RIPTA live data

  • Restore RIPTA TripUpdates and VehiclePositions URLs.
  • Re-add the :netconfig module with a narrowly scoped cleartext exception for realtime.ripta.com only.
  • Keep HTTPS-only behavior for all other hosts.
  • Update documentation to reflect that RIPTA realtime tracking is enabled.

Validation

  • :netconfig:assembleDebug succeeds.
  • git diff --check passes.
  • RTD static and realtime endpoints were verified reachable.
  • RIPTA endpoints are reachable but currently return upstream HTTP 500 responses in this environment; the app now attempts the live feeds instead of disabling them.
  • Full tool build remains dependent on the private GitHub Maven credential for com.thelightphone.lp3keyboard:ui:0.0.16.,workdir

- Merge Bustang GTFS into RTD Denver as an additional static feed, with
  per-feed ID namespacing (feed1:) to prevent key collisions.
- Rework GtfsIngestor to build a temp database and atomically move it into
  place, avoiding deleting an in-use database (SQLiteReadOnlyDatabaseException).
- Use ZipFile instead of ZipInputStream for reliable entry reads.
- Serialize ingestion with a mutex and cancel the previous ingest job when
  switching agencies.
- Store feed URLs in feed_meta.txt so a changed URL forces a refresh.
- Support directionless routes (nullable directionId) end-to-end and
  auto-skip direction selection when a route has no directions.
- Disable RIPTA realtime (HTTP-only feeds) and remove the :netconfig
  cleartext exception module.
Copilot AI lite review requested due to automatic review settings August 6, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown

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 expands the transit tool’s GTFS ingestion and browsing capabilities by supporting multi-feed static GTFS ingestion (RTD Denver + Bustang) with ID namespacing, improving ingestion reliability during agency switching, enabling schedule browsing for routes without direction_id, and restoring RIPTA realtime support via a narrowly scoped cleartext networking exception.

Changes:

  • Add multi-feed static ingestion for RTD Denver (including Bustang) with per-feed ID namespacing and improved ingestion reliability (temp DB + atomic replace, ZipFile streaming, serialized ingests).
  • Allow nullable direction_id through stop/departure selection flows and auto-advance directionless routes.
  • Restore RIPTA realtime feed URLs and reintroduce :netconfig for a host-scoped cleartext exception; update docs accordingly.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tool/src/main/kotlin/com/thelightphone/transit/HomeScreen.kt Cancels stale ingest jobs on agency switch and prevents older ingests from overwriting newer UI state.
tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsRepository.kt Allows nullable direction_id queries for stops/departures to support directionless routes.
tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsIngestor.kt Adds serialized ingestion, multi-feed loading with ID prefixes, ZipFile-based parsing, and temp DB replacement.
tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsAgency.kt Adds RTD additional static feed URL(s) and updates RIPTA realtime documentation/fields.
tool/src/main/kotlin/com/thelightphone/transit/FirstStopSelectionScreen.kt Propagates nullable directionId into stop selection flow.
tool/src/main/kotlin/com/thelightphone/transit/DirectionSelectionScreen.kt Auto-advances directionless routes directly to stop selection.
tool/src/main/kotlin/com/thelightphone/transit/DepartureListScreen.kt Propagates nullable directionId into departure listing flow.
tool/README.md Updates user-facing notes about RIPTA HTTP-only realtime with scoped exception.
tool/build.gradle.kts Documents the RIPTA cleartext exception dependency on :netconfig.
settings.gradle.kts Adds mavenLocal() to dependency resolution repositories.
README.md Updates top-level documentation about RIPTA HTTP-only realtime with scoped exception.
netconfig/src/main/res/xml/network_security_config.xml Restricts cleartext allowance to realtime.ripta.com and updates module comments.
netconfig/src/main/AndroidManifest.xml Supplies networkSecurityConfig via manifest merge for the tool app.
netconfig/build.gradle.kts Simplifies module header commentary while preserving purpose.

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

Comment thread settings.gradle.kts
Comment on lines 19 to 24
dependencyResolutionManagement {
repositories {
mavenLocal()
google()
mavenCentral()
maven {
Comment on lines +106 to +110
LaunchedEffect(state) {
if (state is DirectionSelectionState.Loaded && (state as DirectionSelectionState.Loaded).directions.isEmpty()) {
navigateTo(screenFactory = { activity ->
FirstStopSelectionScreen(activity, dbFile, routeId, routeLabel, null, "Route")
})

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll investigate and fix this.

Comment thread tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsIngestor.kt Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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