Skip to content

Conversation

@Mephistic
Copy link
Collaborator

We had a minor bug in the bill/hearing sync due to the new logic. The pre-existing logic did not check that the courts of the bills and hearings matched (because we only scraped bill/hearings from the current general court). When we expanded the filter to scrape all hearings, this caused bills from old courts to get matched with current hearings (since bill ids like "H1234" re-occur across courts).

This PR adds a fix to ensure we only match bills/hearings when their courts also match (and adds unit tests to enforce that behavior

… with hearings from the same general court. This was not an issue previously because we only scraped hearings from the current general court, but we removed that filter to accommodate the backfill of the bill/hearing mappings and accidentally broke that logic.

We now will fetch the court of the bills at the start, build a map to keep track of the bill/court linkage, and use that to filter down to only hearings in the same general court. Running this once will overwrite and correct the existing links
…r function for testability, adding unit tests to cover the new logic
@vercel
Copy link

vercel bot commented Jan 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
maple-dev Ready Ready Preview, Comment Jan 5, 2026 1:04pm

@Mephistic
Copy link
Collaborator Author

Going to merge so future runs don't reset the fixed changes in the most recent court - post-merge comments are always welcome.

@Mephistic Mephistic merged commit 1e4b5c7 into codeforboston:main Jan 5, 2026
8 checks passed
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.

1 participant