Map init error handling v2 - #10
Merged
Merged
Conversation
The yellow 'Map source didn't initialize properly' box was a soft 5s timeout warning that auto-cleared once the inner retry pipeline finished. It produced false positives on healthy slow loads. The existing error-state path (Try Again + Legacy Maps Link) is the single error pattern going forward.
When the inner MapLibre data pipeline doesn't reach markersReady within 15s of cameras finishing load, surface the existing error UI (Try Again + Legacy Maps Link) instead of a soft yellow warning that auto-clears. Removes a UX false positive on cold/slow loads while still bounding how long users wait before getting a clear escape hatch.
setMapKey(k => k + 1) was inside the try block of handleRetryWithRemount, so it was skipped when retryCameraLoad threw. After Task 2's switch to a hard error UI, the user clicks Try Again expecting visible recovery; an unconditional remount ensures the map instance is fresh on every retry attempt regardless of whether the camera refetch succeeds.
Synchronous probe that creates an off-DOM canvas, tries to acquire a WebGL2/WebGL/experimental-WebGL context, releases it via WEBGL_lose_context, and returns a boolean. Sub-millisecond on healthy devices. The released context does not count against the browser's concurrent WebGL context limit.
Probe isWebGLAvailable() at the top of the mount effect and the retry handler. When WebGL is unavailable, set mapInitError to a WebGL-specific message and skip the camera fetch entirely instead of waiting for the 15s map-init deadline. The existing error UI (Try Again + Legacy Maps Link) renders the new message verbatim — no schema change.
The hardcoded "Failed to Load Camera Data" heading was misleading on the WebGL/map-init failure paths, where no camera fetch ever happened. The body already carries the specific message; a generic heading applies correctly to every error case.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
deflock-maps | e98af14 | Commit Preview URL Branch Preview URL |
Jun 23 2026, 01:43 AM |
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.
fixed map loading issues "failed to initialize" + minor UI tweaks