A close-the-window UPDATE checked that the row's window was open, not that it was the row the selection rule picks. With two open rows it closed the shadowed fallback and returned 200 naming a "next" that never stopped.
Put the selection rule inside the mutation. A guard that re-derives "active" its own way is wrong for the table.
Seed the production shape in tests. Two open rows caught what one row cannot.
Seed the production shape in tests. Two open rows caught what one row cannot.