Skip to content

explorer: smooth failure-message flicker when tryEnterPointModeIfNeeded chases a failed cluster reload #193

@rdhyee

Description

@rdhyee

Follow-up from #191 (issue #190 fix 2).

Symptom

If a cluster reload fails (e.g. flaky network on the res4/res6 parquet) and the user is at point-mode altitude, the failed reload's call site immediately calls tryEnterPointModeIfNeeded(), which paints Fetching sample index… over the just-painted Failed to load H3 res\${target} — try zooming again. failure message. The user sees the failure flash for a frame, then the helper's loading-state takes over.

This is rare (it requires a cluster-reload failure on a path the camera handler is in, with the user already below ENTER_POINT_ALT) and self-recovering — but it's noisy when it does happen.

Reproduction (synthetic)

  1. Throttle network so res4/res6 parquet fetch fails.
  2. Zoom from world view straight into point altitude (cluster reload fires, fails).
  3. Observe phase-message strip during the transition.

Possible fixes

A few shapes worth considering:

  1. Don't chase after a failed loadRes. The chase is a liveness fix — recovering from supersession that left us silent. A failure already wrote a phase message, so silence isn't the issue. Skip the chase when res8Ready === false:

    const ok = await loadRes(target, ...);
    if (ok) await tryEnterPointModeIfNeeded();

    Tradeoff: distinguishing supersession from failure at call sites where they're conflated (both return false). Could expand loadRes's return to a tri-state ('applied' | 'stale' | 'failed') but that's invasive.

  2. Brief debounce inside tryEnterPointModeIfNeeded. If the helper is called within ~100ms of a phase-message write that wasn't a 'done' state, hold off the loading-message overwrite for that window so the failure remains visible long enough for the user to register it. Heuristic; brittle.

  3. Two-line phase-message slot. Show last error (sticky for N seconds) on a second line instead of overwriting it. Bigger UI change; out of scope for a flicker fix.

Recommendation: (1) with the tri-state return is the cleanest, but only if other call sites also benefit. Otherwise, a one-line if at the chase sites checking ok is enough.

Acceptance

  • Failure messages from cluster-reload paths persist long enough to be human-readable (or at least: are not immediately overwritten by Fetching sample index… in the failure case).
  • Supersession recovery (the actual round-3 fix) still works — toggle source filter during cold-cache wait still ends up in point mode.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions