Skip to content

Conversation

@qcdyx
Copy link
Contributor

@qcdyx qcdyx commented Nov 27, 2025

Summary:

Overwrite rt's static references with the newest matches.
Closes #534

Expected behavior:

Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).

Testing tips:

Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@qcdyx qcdyx linked an issue Nov 27, 2025 that may be closed by this pull request
@qcdyx qcdyx marked this pull request as ready for review December 8, 2025 17:02
Comment on lines 129 to 130
gtfs_rt_feed = self.query_feed_by_stable_id(session, stable_id, "gtfs_rt")
gtfs_rt_feed = self.query_feed_by_stable_id(session, stable_id, "gtfs_rt")
Copy link
Contributor

Choose a reason for hiding this comment

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

these two lines are duplicates

# Wipe any previously persisted raw static_reference on the ORM (avoid stale data)
if hasattr(gtfs_rt_feed, "static_reference") and gtfs_rt_feed.static_reference is not None:
gtfs_rt_feed.static_reference = None
session.add(gtfs_rt_feed)
Copy link
Contributor

Choose a reason for hiding this comment

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

[question] this feed is already in the db (just queried) - any reason we need to add it again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, that's obsolete code that should've be removed.

gtfs_rt_feed = self.query_feed_by_stable_id(session, stable_id, "gtfs_rt")

# Wipe any previously persisted raw static_reference on the ORM (avoid stale data)
if hasattr(gtfs_rt_feed, "static_reference") and gtfs_rt_feed.static_reference is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

If i understand properly, the gtfs_rt_feed variable is of type [Gtfsrealtimefeed | None]. The Gtfsrealtimefeed entity never has a static_reference attribute. The attribute is gtfs_feeds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!

default: true
type: boolean
repository_dispatch: # Update on mobility-database-catalog repo dispatch
types: [ catalog-sources-updated, gbfs-systems-updated ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there anything changed in this file except for formatting? If not I suggest in the future that you do not commit a file like that because it looks like it's part of the solution but it has nothing to do with it. IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, I disabled format-on-save in my VSCode and reverted the changes.

qcdyx added 5 commits December 8, 2025 13:09
…n-changed' of github.com:MobilityData/mobility-feed-api into 534-related-schedule-and-realtime-feeds-dont-update-when-changed
Copy link
Collaborator

@jcpitre jcpitre left a comment

Choose a reason for hiding this comment

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

LGTM!

@qcdyx qcdyx merged commit d362425 into main Dec 9, 2025
2 of 3 checks passed
@qcdyx qcdyx deleted the 534-related-schedule-and-realtime-feeds-dont-update-when-changed branch December 9, 2025 13:43
davidgamez pushed a commit that referenced this pull request Dec 9, 2025
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.

Related schedule and realtime feeds don't update when changed

4 participants