Skip to content

Fix task wiring, invalidation ordering, and queue handling in the pipeline - #1025

Open
kean wants to merge 5 commits into
mainfrom
fix/pipeline-task-wiring
Open

kean wants to merge 5 commits into
mainfrom
fix/pipeline-task-wiring

Conversation

@kean

@kean kean commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Four fixes in the pipeline and the task engine, one commit each.

  • Creating a pipeline reset prefersIncrementalDelivery on a DataLoader shared with another pipeline, so a pipeline derived from a progressive one's configuration turned the increments off for it and it stopped producing previews. The pipeline now only ever turns the flag on for progressive decoding and never writes false, which also leaves a loader the app configured by hand alone.
  • A request created after invalidate() returned could still succeed when invalidate() was called from a lower-QoS thread: both reach the pipeline actor in unstructured hops, and the task's start could overtake the invalidation. invalidate() now records the flag under the existing task-ID lock before it returns, and the task creation reads it in the same lock acquisition it already takes for the ID.
  • A late progressive decode cleared AsyncTask.operation unconditionally when it finished, dropping the handle to the final decode that had replaced it, so cancelling the image task or changing its priority no longer reached the final decode. The handle is now left alone when the finishing operation was cancelled. TaskLoadImage has the same pattern for processing and decompression; it is left for the change that owns that file.
  • .skipDataLoadingQueue was ignored for ImageRequest(id:image:): loadAsyncImage always went through dataLoadingQueue, unlike the URL and ImageRequest(id:data:) paths. It now runs the closure in a Task of its own, cancelled through onCancelled like the data-closure path.

The imageTaskCreated wiring fix moved to #1086.

kean added 5 commits November 2, 2026 19:24
The invalidation and the start of a new task reach the pipeline actor in no particular order, so a task created after invalidate() returned could start before the actor learned about the invalidation. The flag is now recorded under the task-ID lock before invalidate() returns and read by the task creation.
@kean
kean force-pushed the fix/pipeline-task-wiring branch from 3392c32 to 2cca05d Compare November 3, 2026 00:51

This branch has not been deployed

No deployments
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