Skip to content

availableLanguages: fixVideoLanguages and videoPublishChildren cascade to root, race-free #9521

Description

@tanflem

Parent

Sub-issue of #9515 (Rebuild Video.availableLanguages as one cycle-safe, recursively-correct source of truth).

What to build

fixVideoLanguages (the admin repair mutation) and videoPublishChildren (the bulk-publish mutation) both currently trigger only a single-video recompute with no cascade to grandparents — reintroducing the same single-hop bug the rest of this work fixes. Both are changed to trigger the full cascading recompute from #9517. Additionally, videoPublishChildren's per-video recomputes currently run in parallel with no ordering guarantee, so a parent and a just-published child being recomputed in the same request can race — the parent's recompute could read the child's availableLanguages before the child's own recompute has committed. Recomputes are ordered so a child commits before any parent that depends on its value.

Acceptance criteria

  • Calling fixVideoLanguages on a leaf video whose language changed results in the correct value cascading up to its grandparent, not just its immediate parent.
  • A videoPublishChildren call spanning at least three hierarchy levels results in every level's availableLanguages being correct after the mutation completes, with no dependency on lucky timing.
  • A test specifically constructed to catch the previous race (parent and child recomputed in the same request) passes deterministically, not flakily.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions