Closed frasercl closed 9 months ago
I tried running this to test it, and I ran into an error?
Repro:
npm run start
)Uncaught Runtime Errors:
ERROR
chunk request cancelled
at handleError (http://localhost:9020/volume-viewer-ui.bundle.js:25109:58)
at http://localhost:9020/volume-viewer-ui.bundle.js:25132:7
ERROR
chunk request cancelled
at handleError (http://localhost:9020/volume-viewer-ui.bundle.js:25109:58)
at http://localhost:9020/volume-viewer-ui.bundle.js:25132:7
ERROR
chunk request cancelled
at handleError (http://localhost:9020/volume-viewer-ui.bundle.js:25109:58)
at http://localhost:9020/volume-viewer-ui.bundle.js:25132:7
It's possible this is related to the Vast outage today. Will check again later.
I tried running this to test it, and I ran into an error?
Repro:
- Run the project (
npm run start
)- Switch to OME Zarr (NucMorph)
- Switch to Z viewer
Uncaught Runtime Errors: ERROR chunk request cancelled at handleError (http://localhost:9020/volume-viewer-ui.bundle.js:25109:58) at http://localhost:9020/volume-viewer-ui.bundle.js:25132:7 ERROR chunk request cancelled at handleError (http://localhost:9020/volume-viewer-ui.bundle.js:25109:58) at http://localhost:9020/volume-viewer-ui.bundle.js:25132:7 ERROR chunk request cancelled at handleError (http://localhost:9020/volume-viewer-ui.bundle.js:25109:58) at http://localhost:9020/volume-viewer-ui.bundle.js:25132:7
It's possible this is related to the Vast outage today. Will check again later.
Still getting this bug today.
This is all I'm getting from the console:
index.ts:872 currentVol with name AICS-12_881 is loaded
index.ts:872 currentVol with name P13-C4 is loaded
localhost/:1 Uncaught (in promise) chunk request cancelled
index.ts:872 currentVol with name P13-C4 is loaded
If I have any coding time today I'll try to take a look at this error message. This is an important change to get in soon.
The error here is indeed an uncaught promise exception that occurs when we cancel a request. This pull request : https://github.com/gzuidhof/zarr.js/pull/145 actually seems to fix the issue. (also see https://github.com/gzuidhof/zarr.js/issues/140) The problem seems to be that our promises get stuck in the zarr.js plumbing because of their internal logic in between our proxy store's SmartStoreWrapper.getRaw and the resulting multiple calls to the true store's getItem.
You can see some hints of this by changing
return this.requestQueue.addRequest(key, () => this.getAndCacheItem(item, key, opts));
to
return this.requestQueue
.addRequest(key, () => this.getAndCacheItem(item, key, opts))
.catch((e) => {
if (e !== CHUNK_REQUEST_CANCEL_REASON) {
throw e; // this will be unhandled!!!
}
// if cancelled, we still need to return an arraybuffer of the expected size,
// or else handle this one - returning this buffer still breaks things.
return new ArrayBuffer(0);
});
Another way of saying this is: We call getRaw to fetch some data. The getRaw call is converted into many getItem calls by zarr.js's internals. We are overriding getItem in our SmartStoreWrapper. Each getItem becomes a cancellable request promise generated by our RequestQueue. These getItem requests are per-chunk, and are not propagated back out of the SmartStoreWrapper when getRaw finishes.
Resolves #157: If a 3d volume is loaded, the user switches to z-slice mode, and a higher resolution level is available to load, reload at that higher resolution.
This is accomplished using the
loadDims
method onIVolumeLoader
(unused until now), which loads the dimensions of a volume without loading any data. I made the following changes to makeloadDims
a good solution to this issue:loadDims
returns an array ofVolumeDims
objects for each available scale level. I added the propertycanLoad: boolean
to this type to indicate whether a level can be loaded given the specifications.loadDims
isasync
,updateRequiredData
must now beasync
too. This is a bummer, so to compensate, I tried to ensure thatloadDims
rarely or never isasync
in practice.I also got rid of the
scene
property ofLoadSpec
, given that the only loader that supports scenes right now (OmeZarrLoader
) must be bound to a single scene on construction.