maniator / maniator/verticopolis

[Bug]: [P3] Schedule dialog reads a dead sim's demand rings after undo/adoptSim

Open
#475 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Review deferral from the #466 day-split build (/gds-code-review Edge Case Hunter, 2026-07-17), widened by the #465 origin build. The Schedule dialog's stops port and its OK apply deliberately re-read the LIVE sim (getSim()) so undo/redo and adoptSim under the open dialog stay correct, but ctx.hourly AND ctx.origins (#465) are captured once at open from the then-current sim. After an undo restore swaps the Simulation instance, the ghost, advice, Simulate peak, hotspot markers, and Auto-tune keep reading the pre-undo instance's frozen rings while the restored sim's transient rings are empty; since #465, Auto-tune can write authored homeFloors from the dead instance's origin history, not just advisory text. A second wrinkle: a shaft opened before its first hourly sample has ctx.origins === undefined for the dialog's whole life (the rings object is minted inside sampleElevatorUtil), so the mid-open liveness that works for an existing rings object never applies to a fresh shaft's origins.

Fix direction: route both through the same live-port pattern as stops, for example hourly: () => getSim().elevatorHourlyLoad(id) and origins: () => getSim().elevatorOriginLoad(id) re-read on every recompute (the warm gates are already recomputed live since #466's review round, so only the ctx plumbing changes). That also fixes the fresh-shaft case for free.

Review lane: /gds-code-review.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the Schedule dialog and trace the existing getSim(), elevatorHourlyLoad(id), and elevatorOriginLoad(id) entry points, alongside the live stops and warm-gate handling described in the issue. Update the ctx plumbing so hourly and origins are re-read during recomputation; done means undo/adoptSim and a shaft opened before its first sample use the current simulation's rings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.