Repository navigation
fix(deck.gl-geotiff): call MosaicLayer's onSourceError when getSource rejects - #860
Merged
Merged
Conversation
… rejects deck.gl's TileLayer passes onTileError only the error, so the handler that mapped it to an item never ran. getTileData now reports the failure itself, skipping aborted opens as deck.gl does, and onTileError stays a no-op so deck.gl doesn't also log it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mockRestore clears the recorded calls, so the assertion after it could not fail. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
MosaicLayer'sonSourceErrorwas never called. deck.gl'sTileLayerpasses itsonTileErroronly the error, not the tile (this.props.onTileError(error)in 9.4.0 and 9.4.1). MosaicLayer's handler returned early when it had no tile, so it never reached the item.Changes
getTileDatacatches a rejectedgetSource, callsonSourceError(item, { error }), and rethrows, so deck.gl still records the item as failed. It skips aborted opens, as deck.gl skips the callbacks of a cancelled tile.onSourceErroris supplied,onTileErroris a no-op, so deck.gl doesn't also log the error to the console. Supplying it already did that before.Tests
Two
LayerManagertests in "MosaicLayer with an item whose source fails to open":getSourcerejects.onSourceErrorgetsB: Not found, andconsole.errorisn't called. On main it fails withexpected [] to deeply equal [ 'B: Not found' ].getSourcerejects with the abort's reason, asfetchdoes. Removing the layer aborts the open, andonSourceErrorisn't called. The test also checks that the abort happened, so it can't pass without one.Mutation checks: reporting aborted opens too fails the second test, and dropping the no-op
onTileErrorfails the first (console.erroris called once).The deck.gl-geotiff tests (224),
pnpm -r --filter='!docs' typecheckand Biome pass.🤖 Written by Claude Code