Skip to content

Observe encoded-data buffer operations through the pipeline delegate - #1047

Open
karim-alweheshy wants to merge 1 commit into
kean:mainfrom
karim-alweheshy:observe-data-buffer-updates
Open

karim-alweheshy wants to merge 1 commit into
kean:mainfrom
karim-alweheshy:observe-data-buffer-updates

Conversation

@karim-alweheshy

Copy link
Copy Markdown

Encoded-data allocation failures can leave the application with a failing allocation site but no context about the operation that preceded it. Add a synchronous pipeline-delegate hook immediately before initial reservation, resumed reservation, and append, so applications can sample their own memory diagnostics at those boundaries.

The context contains logical byte counts, the requested reservation capacity when available, and the response metadata. It exposes no body data. The callback runs on ImagePipelineActor once per underlying fetch operation; its default implementation is empty and pipelines with the default delegate skip it. Consumers should sample before collecting expensive metrics and return quickly.

Validation: 23 macOS tests pass across the buffer-update and resumable-download suites, covering known and unknown lengths, default delegates, single-chunk responses, size rejection, and resumed prefixes. The repository CI lint command passes, and strict lint passes for the changed source files.

@karim-alweheshy
karim-alweheshy marked this pull request as ready for review October 28, 2026 03:04
@kean kean added this to the 14.1.0 milestone Nov 8, 2026
@karim-alweheshy
karim-alweheshy force-pushed the observe-data-buffer-updates branch from 22f6d0e to 090f93d Compare November 10, 2026 11:39
@karim-alweheshy

Copy link
Copy Markdown
Author

hey @kean, I’ve rebased this PR. Could you approve the CI run and share your take on whether the pipeline delegate is the right place for this hook? It exposes buffer metadata without changing how Nuke buffers data.

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.

2 participants