Skip to content

Fix: admin firework/multishot saves time out from unscoped timeline-safety triggers #342

Description

@liammaloney2403

Saving a firework or multishot shot in Admin could time out because the database's timeline-safety triggers re-validated every show and every published preset on every write, instead of just the ones the write could affect.

  • Root cause: assert_show_timeline_non_overlapping() (3.6s) and assert_all_published_show_presets() (2.6s) ran unscoped on every catalogue_items / fireworks / multishot_fireworks write; fan-out repeated this once per multishot reusing an edited firework (reproduced a >60s hang on a firework used in 17 multishots)
  • Fix: migration platform/supabase/migrations/20260810120000_scope_show_timeline_safety_checks.sql scopes both checks to the shows/catalogue items actually affected, and adds WHEN guards so duration-propagation triggers skip when nothing relevant changed
  • Verified: full unscoped audit still passes (0 overlaps across 67 shows / 163 published presets), existing 27-test overlap-safety suite passes unchanged, and a genuine unsafe duration change is still correctly rejected
  • Result: firework save >60s timeout → 274ms; multishot shot save 9.0s → 246ms
  • Testing log: platform/docs/firework-timeline-safety-performance.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions