You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
eeg-viewer: superseded and closed mounts leave zarr fetches in flight #208
src/lib/eeg-viewer/store.ts contains no AbortController anywhere. Every range request it issues against zarr.nemar.org runs to completion regardless of whether anyone still wants the result.
That happens on ordinary interactions, not just edge cases:
Opening file A, then switching to file B before A's store finishes opening. A's requests keep streaming; the response is parsed and discarded.
Closing the viewer modal mid-load. Same.
Switching channel groups while a window read is in flight.
Why it is worth fixing separately
#206 fixed the correctness half of this: a superseded mount now bails via an isStale predicate before it can clobber the slot, so those responses no longer resurrect a dead viewer or orphan a live one. What remains is purely wasted work — bandwidth, Worker subrequests, and client CPU spent decoding chunks nobody will look at.
On a large montage the discarded read is not small, and a user skimming several recordings on one dataset page can stack up a few of these in a row.
Ask
Thread an AbortSignal through openRecording and the window/overview reads in store.ts, and abort it from the viewer's existing teardown path (destroy()), which already unwinds observers, listeners, and the WebGL context. The sequencing state needed to decide when to abort already exists: renderSeq inside the viewer, and eegModalSeq / isStale at the mount boundary.
Note the byte-transfer caveat that applies elsewhere in this repo does not apply here: these are bounded chunk reads for a view the user has navigated away from, not a long-running user-initiated transfer, so aborting them is correct rather than hostile.
Activity
neuromechanist commentedon Sep 3, 2026
Fixed in #281 (staging commit a02b4b3); ships with the next staging promotion.