Skip to content

[6.x] Dedupe concurrent Control Panel asset requests - #15252

Merged
jasonvarga merged 2 commits into
6.xfrom
cp-request-dedupe
Aug 24, 2026
Merged

[6.x] Dedupe concurrent Control Panel asset requests#15252
jasonvarga merged 2 commits into
6.xfrom
cp-request-dedupe

Conversation

@jasonvarga

@jasonvarga jasonvarga commented Aug 24, 2026

Copy link
Copy Markdown
Member

A publish form with several asset fields fires the same assets-fieldtype request once per field. Markdown fields and Bard image nodes hit the same endpoint. When those requests are identical and concurrent, share one promise instead of sending duplicates.

dedupeInFlight(namespace, key, factory) collapses concurrent identical in-flight work onto a single shared promise. The entry is dropped as soon as the promise settles, so no settled response is ever reused — this is not a cache and has no staleness window. Every caller receives the same real response, and if the request fails they all reject together.

The assets fieldtype clones its copy of the response so edits to one field's asset rows can't bleed into another field sharing the same in-flight response.

Split out of #15158.

Multiple asset fields, markdown fields, and Bard image nodes on the same
page each fire their own POST to assets-fieldtype on mount. When those
requests are identical and concurrent, share one promise instead.

The shared promise is dropped as soon as it settles, so this only ever
collapses in-flight duplicates - no settled response is ever reused.
@jasonvarga
jasonvarga merged commit dc4f60d into 6.x Aug 24, 2026
66 checks passed
@jasonvarga
jasonvarga deleted the cp-request-dedupe branch August 24, 2026 16:11
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