Skip to content

Batch multi-selection actions into single requests#2125

Open
frankrousseau wants to merge 8 commits into
cgwire:mainfrom
frankrousseau:main
Open

Batch multi-selection actions into single requests#2125
frankrousseau wants to merge 8 commits into
cgwire:mainfrom
frankrousseau:main

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problem

  • Many multi-selection actions fired one HTTP request per selected item (or per production), N requests where a single one suffices: clearing a person's assignation on a selection, the schedule auto-distribution, creating an entity's default tasks, adding selections/episodes/movies to a playlist, deleting a selection of entities, saving casting on a selection, and changing task priority on a selection.
  • runPromiseAsSeries received already-created promises, so its call sites fired in parallel despite reading as serialized; the "add movie" playlist path also rewrote the whole playlist once per shot, racing against concurrent edits.

Solution

  • Clear a person's assignation on a selection, change priority on a selection, and create an entity's default tasks now each use a single request (via the existing clear-assignation route, the new set-priority route, and the entity tasks route respectively).
  • Batch the schedule auto-distribution's assign/unassign into one request per assignee instead of one per task.
  • Add a selection, an episode or a whole movie to a playlist, delete a selection of assets/shots/edits/concepts, and save casting on a selection now each use one request via the new zou batch routes.
  • Replace runPromiseAsSeries with real serialization (runPromiseMapAsSeries), which creates each promise only after the previous resolves, and drop the misleading helper.
  • The playlist, delete-entities, casting and set-priority parts depend on the new routes in Add batch action routes for multi-selection Kitsu operations zou#1145.

frankrousseau and others added 8 commits July 7, 2026 23:46
The action panel and the task list fired one clear-assignation request
per selected task. The route accepts a task id list, so send a single
request for the whole selection.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The schedule distribution fired one unassign and one assign request per
task, defeating the batch routes. Accumulate task ids during the
distribution loop, then send one clear-assignation request plus one
assign request per assignee.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Creating a shot, asset, sequence, episode or edit fired one create-task
request per production task type. Use the entity tasks route, which
accepts the task type id list, to create them all in one request. As a
side effect, episode and sequence creation no longer sweeps every
entity of the project through the id-less create-tasks route.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
runPromiseAsSeries received already-created promises, so the underlying
requests fired in parallel and only completion was chained. Convert its
call sites to runPromiseMapAsSeries, which creates each promise after
the previous one resolves, and drop the misleading helper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adding a selection, an episode or a whole movie to a playlist fired two
requests per entity (preview files fetch plus a full playlist rewrite),
racing against concurrent edits. Use the new add-entities action route:
one request for the batch, then one playlist reload to refresh the
player.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deleting a selection of assets, shots, edits or concepts fired one
DELETE request per entity, in series. Use the new delete-entities
action route: one request for the whole selection, then the same
cancel-or-remove store updates as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adding an asset to a selection, removing it from the selection and
pasting a casting fired one full-replace request per selected entity.
Apply the local casting changes first, then persist them all through
the new batch entities casting route in a single request.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
changeSelectedPriorities issued one update request per selected task,
in series. Use the new set-priority action route to update the whole
selection in a single request, then apply the returned tasks to the
store.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant