Skip to content

Keep pending resources during concurrent head merges - #4130

Open
jay23606 wants to merge 2 commits into
bigskysoftware:four-devfrom
jay23606:fix-hx-head-pending-resource-race
Open

jay23606 wants to merge 2 commits into
bigskysoftware:four-devfrom
jay23606:fix-hx-head-pending-resource-race

Conversation

@jay23606

@jay23606 jay23606 commented Oct 9, 2026

Copy link
Copy Markdown

Concurrent hx-head="merge" responses can remove a stylesheet or blocking script while an earlier response is waiting for its load event. If removal prevents that event from firing, the earlier response never reaches its swap.

Track render-critical resources while they load and keep them in the head during concurrent merges. Add a three-second ceiling to the wait so a resource that never settles cannot hold a swap indefinitely. The regression test stalls a stylesheet, performs a second merge, then confirms the stylesheet remains and the first swap completes.

Fixes #4100.

Validation: npm run test:chrome (1,782 passed, 0 failed, 4 skipped).

@scrhartley

Copy link
Copy Markdown
Contributor

Warning: this PR is likely to conflict with PR #4092

@jay23606
jay23606 force-pushed the fix-hx-head-pending-resource-race branch from 68c29e7 to ac3571b Compare October 16, 2026 20:15
@scrhartley

Copy link
Copy Markdown
Contributor

If you ignore responses where the target is no longer connected, then you are also preventing any OOB swaps from happening that would have succeeded. Is this intended? What is the reasoning behind this change?

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