Skip to content

Fix flowsheet ETL show_id FK violation and timezone handling#300

Merged
jakebromberg merged 2 commits intomainfrom
bugfix/etl-fixes
Apr 6, 2026
Merged

Fix flowsheet ETL show_id FK violation and timezone handling#300
jakebromberg merged 2 commits intomainfrom
bugfix/etl-fixes

Conversation

@jakebromberg
Copy link
Copy Markdown
Member

Summary

  • Change show_id: backendShowId ?? 0 to ?? null in bulk load path (FK violation fix)
  • Replace hardcoded -04:00 EDT offset with dynamic EST/EDT resolution using Intl.DateTimeFormat
  • Add tests for summer (EDT), winter (EST), spring-forward, and fall-back DST transitions

Closes #295

Test plan

  • Unit test: July date uses EDT offset (UTC-4)
  • Unit test: January date uses EST offset (UTC-5)
  • Unit test: Spring-forward transition date (March 12, 2023)
  • Unit test: Fall-back transition date (November 5, 2023)
  • Full ETL test suite passes (56 tests)

Jake Bromberg added 2 commits April 5, 2026 17:20
…load

show_id 0 would violate the FK constraint since no show has id 0. The incremental sync path already uses null correctly.
The previous implementation hardcoded UTC-4 (EDT), producing timestamps off by one hour for entries during EST (November-March). Uses Intl.DateTimeFormat to determine the correct Eastern offset at each datetime, with a two-pass approach to handle DST transition edge cases.
@jakebromberg jakebromberg merged commit 95274ce into main Apr 6, 2026
4 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.

Bug: flowsheet ETL show_id FK violation and hardcoded EDT timezone

1 participant