Skip to content

fix(deck.gl-zarr): raise Zarr open failures through onError - #654

Closed
kylebarron wants to merge 1 commit into
mainfrom
fix/raise-zarr-open-errors
Closed

kylebarron wants to merge 1 commit into
mainfrom
fix/raise-zarr-open-errors

Conversation

@kylebarron

Copy link
Copy Markdown
Member

updateState discarded the _parseZarr() promise with void, so every failure it can produce was swallowed into an unhandled rejection: a mistyped variable, malformed GeoZarr attrs, unnamed array dimensions, an invalid selection, or a rejecting epsgResolver. The layer simply rendered nothing and the carefully written error messages never reached the app.

Route those through Layer.raiseError so they surface via onError, mirroring the COG layers (#652). Rejection values are normalized before use, since a resolver rejecting with a non-Error would otherwise make error.message throw inside the catch handler and produce the same unhandled rejection this is meant to fix.

Surfacing the errors needs a cancellation story that ZarrLayer lacked entirely, so add one: an AbortController in layer state, aborted by a new finalizeState and replaced on every re-parse. Without it, a layer unmounted mid-open would start raising errors the app can no longer act on. The same controller closes a pre-existing race where a slow earlier parse could resolve after a newer one and write its arrays and descriptor over the newer state. Nothing threads the signal into zarrita, so this guards state writes rather than cancelling reads.

Also drops three window.root/window.group/window.meta debugging assignments that were shipping in the parse path.

What I am changing

How I did it

How you can test it

Related Issues

`updateState` discarded the `_parseZarr()` promise with `void`, so every
failure it can produce was swallowed into an unhandled rejection: a
mistyped `variable`, malformed GeoZarr attrs, unnamed array dimensions, an
invalid `selection`, or a rejecting `epsgResolver`. The layer simply
rendered nothing and the carefully written error messages never reached
the app.

Route those through `Layer.raiseError` so they surface via `onError`,
mirroring the COG layers (#652). Rejection values are normalized before
use, since a resolver rejecting with a non-Error would otherwise make
`error.message` throw inside the catch handler and produce the same
unhandled rejection this is meant to fix.

Surfacing the errors needs a cancellation story that ZarrLayer lacked
entirely, so add one: an AbortController in layer state, aborted by a new
`finalizeState` and replaced on every re-parse. Without it, a layer
unmounted mid-open would start raising errors the app can no longer act
on. The same controller closes a pre-existing race where a slow earlier
parse could resolve after a newer one and write its arrays and descriptor
over the newer state. Nothing threads the signal into zarrita, so this
guards state writes rather than cancelling reads.

Also drops three `window.root`/`window.group`/`window.meta` debugging
assignments that were shipping in the parse path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the fix label Sep 22, 2026
@kylebarron
kylebarron marked this pull request as draft September 22, 2026 14:54
@kylebarron

Copy link
Copy Markdown
Member Author

We do need to refactor Zarr parsing to emit errors through onError, but for now I just want to finally get the release out #638

@kylebarron kylebarron closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant