Skip to content

Fix log-stream ordering, server lifecycle, style selector, shape validation and 3D/node panel defects - #180

Merged
amorfinv merged 7 commits into
mainfrom
fix/log-stream-lifecycle-and-ui-defects
Aug 19, 2026
Merged

Fix log-stream ordering, server lifecycle, style selector, shape validation and 3D/node panel defects#180
amorfinv merged 7 commits into
mainfrom
fix/log-stream-lifecycle-and-ui-defects

Conversation

@amorfinv

Copy link
Copy Markdown
Collaborator

Summary

Integrated backend:

  • Log streamer: a line arriving mid-flush could spawn a second concurrent flush task and deliver lines out of order; the flush task now drains until empty and the scheduled flag is cleared under the feed lock (and on a raising emit), so the stream can neither reorder nor go silent permanently.
  • Process manager: a failing killpg (e.g. PermissionError) stranded the state at "stopping", blocking every later start with no way to clear it — teardown now re-derives the state from whether the process is actually alive. kill() on an already-stopped server no longer claims it killed something.

Frontend:

  • Map style selector: the Apply button now hides on the placeholder selection (it used to linger after deleting a saved style), and saving a custom style whose URL duplicates a predefined option now selects the saved optgroup entry instead of the predefined one (which hid its Delete button). SettingsModal restores the API key embedded in a persisted MapTiler style URL on open, without clobbering a typed key.
  • Shape drawing: top/bottom altitude inputs are validated — non-numeric values no longer leak into the BlueSky command as NaN, and a half-filled pair is rejected instead of silently dropped.
  • 3D overlay: the aircraft scale/model controls were pinned visible by CSS !important rules regardless of the overlay state; they now follow the toggle, and a failed toggle rolls back storage so it isn't resurrected on reload.
  • Simulation nodes panel: teardown removed all node_info listeners (including SocketManager's forward listener) via bare off('node_info'); it now removes only its own handler, and re-wiring can't double-subscribe. Also drops the unused demo-mode Add Node modal and dead setActiveNode/requestNodes pass-throughs.

🤖 Generated with Claude Code

amorfinv and others added 7 commits August 19, 2026 20:40
Drain the pending buffer in a loop inside a single flush task instead of
clearing the scheduled flag before emitting, so a line arriving mid-flush
can no longer spawn a second concurrent flush task that interleaves newer
lines among older chunks. Clear the flag under the feed lock on exit and
on any raising emit/sleep, so the stream can never go silent for good.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
If signalling the process group raised anything but ProcessLookupError,
stop() left the state stranded at "stopping", making every later start()
wait out the 15s shutdown grace and then refuse, with no way to clear it.
Teardown is now wrapped so the state is re-derived from whether the
process is actually alive, and group signalling tolerates an
already-exited group.

kill() also no longer reports "BlueSky server killed" when there was no
live process to kill; the UI shows that message verbatim.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Apply Map Style button now hides when the placeholder is selected
(it used to stay visible after deleting a saved style), and saving a
custom style whose URL duplicates a predefined option now selects the
saved optgroup entry instead of the predefined one, which hid its
Delete button. Selector wiring is characterized by a new test file.

SettingsModal now restores the API key embedded in a persisted MapTiler
style URL when the modal opens, so Apply works without re-entering it;
a key the user already typed is never clobbered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The draw modal's top/bottom altitude fields are now parsed by a shared
parseAltitudeInputs helper: non-numeric values are rejected instead of
leaking into the BlueSky command as NaN, and a half-filled pair is
rejected instead of being silently dropped. Modal state is only mutated
once validation passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The aircraft 3D scale and model containers were pinned visible by CSS
!important rules, so they ignored the overlay state entirely. The panel
now drives their visibility from the toggle (including initial load from
storage), and a failed overlay toggle rolls back storage too, so the
failure isn't resurrected on the next page load.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SimulationNodesPanel now unsubscribes only its own node_info handler on
destroy and re-wiring; the previous bare off('node_info') also detached
SocketManager's forward listener for the same event, and re-setting the
socket manager could double-subscribe. Node names in logs and the kill
confirmation now use the shared alias helper.

Also removes the unused demo-mode Add Node modal from the template and
the dead setActiveNode/requestNodes pass-throughs in App/SocketManager.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Artifact of the local npm version rewriting optional-dependency
metadata; no dependency changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@amorfinv
amorfinv merged commit 2415e40 into main Aug 19, 2026
2 checks passed
@amorfinv
amorfinv deleted the fix/log-stream-lifecycle-and-ui-defects branch August 19, 2026 18:43
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