Skip to content

fix(deck.gl-geotiff): keep MosaicLayer drawing after an item's source fails to open - #833

Merged
kylebarron merged 2 commits into
mainfrom
kyle/mosaic-failed-source
Nov 2, 2026
Merged

kylebarron merged 2 commits into
mainfrom
kyle/mosaic-failed-source

Conversation

@kylebarron

Copy link
Copy Markdown
Member

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

Once one item's getSource rejects, MosaicLayer throws on every later update, and items that load afterward never draw.

deck.gl settles a tile whose getTileData rejected with null content, and TileLayer still renders that tile, passing data: null to renderSubLayers. MosaicLayer's renderSubLayers destructured it, so TileLayer.renderLayers threw at that tile on every update. deck.gl then kept the sublayers of the last render that succeeded, which lack every item loaded since.

renderSubLayers now returns null for an item without content, as RasterTileLayer already does. The failure is still reported once per load: through onSourceError if it's set, and otherwise by deck.gl's default onTileError, which logs it.

Tests

Two LayerManager tests with an item whose getSource rejects:

  • Later updates raise no errors. Before the fix, each update raised Cannot destructure property 'item' of 'props.data' as it is null.
  • An item added after the failure draws. Before the fix, it never drew: the failed tile comes first in the cache, so the throw ends the render loop before it.

The deck.gl-geotiff suite and its typecheck pass.

Closes #798

🤖 Written by Claude Code

… fails to open

deck.gl passes `data: null` to renderSubLayers for a tile whose
getTileData rejected. MosaicLayer destructured it, so every later update
threw, and items loaded after the failure never drew.

Closes #798

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the fix label Nov 2, 2026

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅

@kylebarron
kylebarron enabled auto-merge (squash) November 2, 2026 23:45
@kylebarron
kylebarron merged commit 95a53aa into main Nov 2, 2026
3 checks passed
@kylebarron
kylebarron deleted the kyle/mosaic-failed-source branch November 2, 2026 23:48
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.

MosaicLayer throws on every update after a source fails to load

1 participant