Skip to content

Map init error handling v2 - #10

Merged
flockhopper3 merged 9 commits into
masterfrom
map-init-error-handling-v2
Jul 10, 2026
Merged

Map init error handling v2#10
flockhopper3 merged 9 commits into
masterfrom
map-init-error-handling-v2

Conversation

@flockhopper3

Copy link
Copy Markdown

fixed map loading issues "failed to initialize" + minor UI tweaks

flockhopper3 and others added 9 commits April 30, 2026 20:47
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>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@flockhopper3
flockhopper3 merged commit 53fc405 into master Jul 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant