Skip to content

availableLanguages: removing a child correctly drops a stale language #9518

Description

@tanflem

Parent

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

What to build

Removing a video from a container's children correctly drops a language it uniquely provided from that container's availableLanguages. Today, removing a child fires reconciliation for its variants, but by the time that reconciliation runs the parent-child relation is already severed, so the old parent is structurally unreachable through the normal path and the stale language sticks forever.

videoUpdate's child-removal handling is changed to explicitly recompute the old parent (using the engine from #9517) after the relation is severed, and cascade that recompute upward to the root.

Acceptance criteria

  • A container with a single child that uniquely provides language X: removing that child from the container's childIds results in the container's availableLanguages no longer including X.
  • A container with two children, one providing language X uniquely and the other not: removing the child that does not provide X leaves the container's availableLanguages unchanged.
  • The recompute triggered by removal cascades to the root, not just the immediate parent (a grandparent's availableLanguages also updates when appropriate).
  • Adding a child to childIds in the same mutation continues to work as before (no regression on the already-correct add path).

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