Skip to content

fix(environments): revoke library blob urls only after their replacement lands - #40

Merged
rosspeili merged 2 commits into
ARPAHLS:mainfrom
AUDOSt0ck1ng:fix/env-blob-revoke-order
Aug 7, 2026
Merged

fix(environments): revoke library blob urls only after their replacement lands#40
rosspeili merged 2 commits into
ARPAHLS:mainfrom
AUDOSt0ck1ng:fix/env-blob-revoke-order

Conversation

@AUDOSt0ck1ng

Copy link
Copy Markdown
Collaborator

Closes #39.

refreshEnvLibrary revoked the previous folder's blob URLs on its first line and
then awaited the replacement, leaving the stage and the picker pointing at URLs
that no longer resolved. Already-decoded images survive revocation so nothing
looked wrong on screen, but a fresh load of those URLs failed — which is what
remounting the accordion does.

The previous list is now held in a local and dropped once the replacement is in
state. The cancelled path deliberately does not revoke it: a newer run captured
the same list and owns retiring it, so revoking there would just move the
early-revoke window up a level.

Verification

Probe hooks URL.revokeObjectURL and tests every blob URL the DOM and
--holo-image reference for liveness. Identical folder switch and protocol
across both runs; this change is the only variable:

before after
revoke burst 2 2
referenced 1 1
dead 1 0
fresh <img> for a dead url FAILED n/a
verdict CONFIRMED — the ui referenced revoked urls clean — referenced urls stayed alive throughout

The reference also survives the whole load now instead of disappearing once
React falls back to a bundled environment, so the old background stays visible
until the new folder is ready.

Scope

Only the environments library path. Does not touch #22 — that investigation ruled
out the main thread and is waiting on reporter info.

🤖 Generated with Claude Code

AUDOSt0ck1ng and others added 2 commits August 7, 2026 14:06
…ent lands

refreshEnvLibrary revoked the previous folder's blob urls on its first line and
then awaited the replacement, so between the two the stage and the picker still
referenced urls that no longer resolved. Revocation does not blank an image that
already decoded, so nothing looked wrong — but a fresh load of those urls failed,
which is exactly what remounting the accordion does.

Hold the previous list in a local and drop it once the replacement is in state.
The cancelled path deliberately does not revoke it: a newer run captured the same
list and is responsible for retiring it, so revoking here would reintroduce the
early-revoke window one level up.

Verified with a probe that hooks URL.revokeObjectURL and tests every blob url the
DOM and --holo-image reference for liveness. Same folder switch, same protocol,
only this change differing:

  before  t+42ms  referenced=1  dead=1  | fresh <img> for a dead url FAILED
          window ended: CONFIRMED — the ui referenced revoked urls

  after   t+10ms  referenced=1  dead=0
          t+10319ms  referenced=1  dead=0
          window ended: clean — referenced urls stayed alive throughout

The reference now also survives the whole load rather than vanishing once React
falls back to a bundled environment, so the old background stays visible until
the new folder is ready.

Closes ARPAHLS#39.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… changelog

Also revoke the just-loaded blob list when error/empty paths clear the library, and add an Unreleased Fixed entry for the revoke-after-replace ordering (ARPAHLS#39, ARPAHLS#40).
@rosspeili
rosspeili force-pushed the fix/env-blob-revoke-order branch from 03c91ff to 9436620 Compare August 7, 2026 11:07
@rosspeili

Copy link
Copy Markdown
Contributor

Thanks @AUDOSt0ck1ng, also confirmed.

Pushed a small follow-up on this branch: CHANGELOG.md [Unreleased] Fixed for #39/#40, and revoke the just-loaded list on the error/empty clear paths so those blobs aren’t left behind. <3

@rosspeili
rosspeili merged commit 943010d into ARPAHLS:main Aug 7, 2026
1 check passed
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.

[Bug]: environment library blob URLs are revoked before their replacement loads

2 participants