Skip to content

Render result runtime sync bugfix (2026-03-11)

Symptom

When map rendering partially failed (for example, invalid pathHex or invalid roomProperties) but the main map still rendered successfully, simulator flows incorrectly treated the whole render as failed.

This blocked runtime synchronization and could prevent import-based scene recovery from applying runtime snapshot data.

Reproducible steps

  1. Provide a valid mapHex.
  2. Provide an invalid pathHex or malformed roomProperties.
  3. Trigger render or import diagnostic dump.
  4. Observe that map can appear, but runtime synchronization/recovery is skipped.

Root cause

usePlaygroundRender.renderMap() returned a single boolean and used false for both:

  • fatal map-render failure, and
  • non-fatal overlay parse failures.

useMapPlayground.renderMapWithRuntimeSync() interpreted false as a hard failure and returned early, skipping runtime sync.

Patch summary

  • Changed renderMap() to return structured result:
    • rendered: whether the main map render succeeded.
    • hasWarnings: whether non-blocking overlay errors occurred.
    • errors: captured warning/error messages.
  • Updated runtime sync guard to proceed when rendered === true, even with warnings.
  • Kept status messaging explicit for warning cases while preserving successful map render flow.

Risk assessment

  • Low-to-medium risk: modifies render result contract used by playground orchestration.
  • Limited blast radius: affected call sites are inside simulator core.
  • Expected impact: restores runtime synchronization in partial-failure scenarios without masking fatal map failures.

Regression checklist

  • [ ] Valid mapHex + invalid pathHex still renders map and syncs runtime.
  • [ ] Valid mapHex + invalid roomProperties still renders map and syncs runtime.
  • [ ] Import flow with non-fatal overlay errors still applies runtime snapshot.
  • [ ] Fatal mapHex parse failure still blocks sync and reports error.

最后更新于: