Skip to content

feat: Fix HASTUS exports with existing service IDs #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 4, 2025

Conversation

jzimbel-mbta
Copy link
Member

@jzimbel-mbta jzimbel-mbta commented Mar 31, 2025

Summary of changes

Asana Ticket: 🏹 Handle duplicate service IDs in HASTUS imports

Screenshot 2025-03-31 at 12 54 25

Summary of approach

During parsing of the uploaded HASTUS export zip:

  • Check if any service IDs in the export already exist in hastus_services table.
  • If they do, immediately amend the export so that the IDs are unique, and indicate to the LiveView that the export was amended.
    This ensures that we don't keep any bad export data in memory that could accidentally be saved to the DB or uploaded to S3.

If the export was amended during parsing:

  • Replace the save / cancel buttons with a warning about the duplicate service IDs, and ask user for confirmation
  • If user clicks Yes, clear the warning and show the usual save / cancel buttons. (The export has already been amended, so no additional processing is needed.)
  • If user clicks No, cancel the entire upload.

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes.

@jzimbel-mbta jzimbel-mbta requested review from a team and lemald and removed request for a team March 31, 2025 16:32
@lemald
Copy link
Member

lemald commented Mar 31, 2025

@jzimbel-mbta I'm going to wait on seeing the final version and the tests before actually approving, but I've taken a look over what you've got so far and I think it looks mostly good - no comments for the moment. 👍

@jzimbel-mbta jzimbel-mbta requested a review from a team as a code owner April 3, 2025 17:09
@jzimbel-mbta jzimbel-mbta merged commit 5a8fa22 into master Apr 4, 2025
10 checks passed
@jzimbel-mbta jzimbel-mbta deleted the jz-hastus-import-handle-dup-service-ids branch April 4, 2025 13:50
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