[P3] Unit changes leave the safety-stop target and switch-depth draft in the old units #33

Closed
opened 2026-10-27 02:59:42 +00:00 by pedro · 1 comment
Owner

Priority: P3
Type: bug
Source: project review requested 2026-10-26 (second pass)

Location: src/App.tsx:559-566, 3032

Problem and evidence

Switching imperial to metric during a simulated safety stop changes the stop depth from 4.572 m (15 ft) to 5 m; the stop is silently cancelled and the diver holds at 4.6 m indefinitely. Loading a plan saved in the other unit system calls setUnits directly, so the Advanced-mode switch-depth draft ("70" ft) becomes 70 m and Add switch fails.

Suggested correction

Record the safety-stop depth when the stop starts rather than deriving it from current units, and apply the same switch-depth conversion when a plan restores units.

Acceptance criteria

Browser regression for the unit switch during a safety stop and for restored-plan units; pnpm verify passes.

Scope: maintenance of the educational simulator. Preserve historical R1 acceptance and operational-validation limits.

Priority: P3 Type: bug Source: project review requested 2026-10-26 (second pass) Location: `src/App.tsx:559-566, 3032` Problem and evidence Switching imperial to metric during a simulated safety stop changes the stop depth from 4.572 m (15 ft) to 5 m; the stop is silently cancelled and the diver holds at 4.6 m indefinitely. Loading a plan saved in the other unit system calls setUnits directly, so the Advanced-mode switch-depth draft ("70" ft) becomes 70 m and Add switch fails. Suggested correction Record the safety-stop depth when the stop starts rather than deriving it from current units, and apply the same switch-depth conversion when a plan restores units. Acceptance criteria Browser regression for the unit switch during a safety stop and for restored-plan units; pnpm verify passes. Scope: maintenance of the educational simulator. Preserve historical R1 acceptance and operational-validation limits.
Author
Owner

Fixed on maintenance/review-2026-10-27 in 137cfcf, 96ec976 — PR #40.

Safety stop records its depth at start; restored plan units convert the switch-depth draft. Follow-up from independent review: the once-registered share-link listener now reads the latest restore callback (later same-tab links had misconverted 21.3 → 6.5). Browser regression fails without the fix.

Branch verification: pnpm verify 145 tests and release budgets; Chromium/Firefox/WebKit review, replay, compatibility and offline lifecycle checks; CI verify runs #111/#112 pass. Record: docs/MAINTENANCE-2026-10-27.md. Closes on merge of PR #40.

Fixed on `maintenance/review-2026-10-27` in `137cfcf`, `96ec976` — [PR #40](https://git.guresky.com/pedro/DiveSim/pulls/40). Safety stop records its depth at start; restored plan units convert the switch-depth draft. Follow-up from independent review: the once-registered share-link listener now reads the latest restore callback (later same-tab links had misconverted 21.3 → 6.5). Browser regression fails without the fix. Branch verification: `pnpm verify` 145 tests and release budgets; Chromium/Firefox/WebKit review, replay, compatibility and offline lifecycle checks; CI verify runs #111/#112 pass. Record: `docs/MAINTENANCE-2026-10-27.md`. Closes on merge of PR #40.
pedro closed this issue 2026-10-27 05:39:05 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: pedro/DiveSim#33
No description provided.