Late img source completion overwrites the image from a newer src
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start by tracing load_image and how pending_images subscribers are registered and applied when a NetHandler completes; reproduce the A→B sequence in the issue with a queued NetProvider. Check how any change handles shared requests and A→B→A before settling on a fix. Done means late A completion leaves B displayed; verify by painting and checking the pixel at (50, 50).
Written by the indexing model from the issue text.
Description
Reproduced on unpatched Blitz main 81b48968474614b28364a452af6d4d0ecedcf6a1 (2026-11-16), Windows x64, with the upstream Cargo.lock and nightly-2026-11-14. Our downstream integration is pinned to 0.3.0-beta.4, but the observations below are from a separate checkout of main.
After an <img> changes from A to B, B can finish and be displayed correctly, then a late completion of A replaces it even though the current src still names B.
Reproduction
<style>body { margin: 0 } img { width: 100px; height: 100px }</style>
<img id="pic" src="a.png">
Use a NetProvider that queues requests and their real NetHandler objects, rather than completing them immediately:
- Parse/resolve the document; keep A pending.
- Set
#pic'ssrctob.pngthroughDocumentMutator::set_attribute, then resolve. - Complete B with a valid 1×1 opaque-blue PNG, resolve and paint.
- Complete A with a valid 1×1 opaque-red PNG, resolve and paint again.
With anyrender_vello_cpu::VelloCpuImageRenderer, the pixel at (50, 50) in a 100×100 output is:
after B: [0, 0, 255, 255]
after late A: [255, 0, 0, 255]
Expected: the pixel remains blue after B has become the current image. The stale A completion should not replace it. This report does not require immediately clearing an already displayed image when src changes; the current/pending request distinction is described by HTML's image update algorithm.
The probe passes encoded PNG bytes through the actual handlers and paints the document; it does not inject a fabricated image into the DOM cache. In main, load_image registers the new URL, but the old URL's pending_images subscriber can still contain this node. Its late completion consequently reaches the same node.
I checked #1221 (unused image-cache eviction) and #1587 (external SVG images); neither appears to address this stale <img> completion.
Local implementation sketch
I am not very familiar with Rust, so these snippets are provided only as reference sketches from our local integration, not as an upstream-ready fix.
Our beta.4 integration removes the node's previous ordinary-image subscriptions before registering the new source:
for waiting in self.doc.pending_images.values_mut() {
waiting.retain(|(id, kind)| {
*id != target_id || !matches!(kind, ImageType::Image)
});
}
This is only the subscription-cleanup portion of the local patch. It deliberately leaves other nodes subscribed to the same URL and does not cancel their shared fetch. I have omitted our separate display-clearing code because it should not be treated as a proposal for browser current/pending-image behavior.
An upstream fix may instead validate request/source identity when applying a completion. This excerpt has not been validated as a complete main-branch fix, including A→B→A, shared requests, SVG images and cancellation; the verified failure here is the two-source out-of-order completion above.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 281
- Avg merge
- 6h 6m
- Merged PRs (30d)
- 184
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DioxusLabs/blitz
-
<input type="number"> misses text-entry leaf sizing in layoutPossibly taken @GoCoder7 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
DioxusLabs/blitz#1675 ·
Maintainers usually reply within 1 day
-
Copy, cut and paste shortcuts don't work with Caps Lock or ShiftPossibly taken @nicoburns claimed this 8 days ago. OpenA-Events C-Bug
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
DioxusLabs/blitz#1507 ·
Maintainers usually reply within 1 day
-
Copy and cut work in password inputsPossibly taken @nicoburns claimed this 8 days ago. OpenA-Events A-Forms C-Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DioxusLabs/blitz#1501 ·
Maintainers usually reply within 1 day
-
Panic on live viewport resize when unstyled elements exist in display: none subtreePossibly taken @GoCoder7 claimed this 9 days ago. OpenA-Layout A-Style C-Bug I-Crash
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DioxusLabs/blitz#1488 ·
Maintainers usually reply within 1 day
-
Right-button drag starts a text-selection drag and suppresses `contextmenu`Possibly taken @staging-devin-ai-integration claimed this 24 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
DioxusLabs/blitz#1184 ·
Maintainers usually reply within 1 day
All issues in DioxusLabs/blitz
Similar issues
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pbakaus/impeccable#1601 ·
Maintainers usually reply within 1 day
-
RDF/XML writer: a blank node in two lists is left out of the secondPossibly taken @mrnolte claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
phillord/horned-owl#368 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mongodb/kingfisher#588 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days