Fix shape extrusion, style-change re-render, and consolidate proxy teardown - #186
Merged
Merged
Conversation
The three teardown paths (close, stop_client, _handle_disconnection) each maintained their own copy of "forget all cached server state" and had drifted apart. Extract DataManager._reset_cached_state as the single implementation and route all paths through it, so browsers always receive the cleared node/traffic picture on disconnect. Also remove the dead reconnect() and _ensure_clean_zmq_context() code paths (the app reconnects by building a fresh BlueSkyProxy), and add unit tests covering the teardown paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
start_WebATM, script/wsgi.py, and script/wsgi_integrated.py each duplicated the create_app + BLUESKY_SERVER_HOST wiring. Extract create_configured_app() in WebATM.main and use it everywhere, add allow_unsafe_werkzeug to the python-run fallback of the WSGI scripts, and fix a stale module name in the app.py docstring. Tests cover the new bootstrap and import both WSGI scripts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the hand-rolled struct-format table (which only knew five dtypes and fell back to hex for everything else, e.g. float16, uint64, string arrays) with np.frombuffer on the transmitted dtype string, matching bluesky.network.npcodec. Hex fallback is kept for invalid dtypes and truncated buffers, with tests for the new and fallback paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Polygons without altitude data were extruded to a hard-coded 1000 m; they now stay flat in the 2D layers, matching how BlueSky treats shapes with no vertical extent. The new extrusionBounds() helper (with vitest coverage) also clamps the base into [0, top] so malformed data cannot produce an inside-out extrusion. On map style changes, ShapeRenderer.onStyleChange() re-initialized both renderers and then rendered shapes again on top of the subscription-driven render, and Shape3DRenderer re-initialized itself independently. The 3D renderer now just marks its layers as lost and lets the owning ShapeRenderer rebuild everything once. The duplicated "recreate source then retry setData" logic moves into a shared updateSourceWithRecovery() helper in utils/maplibre. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four independent cleanups/fixes, one per commit:
close,stop_client,_handle_disconnection) each carried a drifting copy of the cached-state clearing. They now all funnel through a singleDataManager._reset_cached_state(), so browsers always get the cleared node/traffic picture on disconnect. Deadreconnect()/_ensure_clean_zmq_context()paths removed, unit tests added (tests/test_connection_manager.py).start_WebATM,script/wsgi.py, andscript/wsgi_integrated.pyduplicated thecreate_app+BLUESKY_SERVER_HOSTwiring; extracted intocreate_configured_app()with tests that import both WSGI scripts.make_json_serializablewithnp.frombufferon the transmitted dtype string (matchingbluesky.network.npcodec), so float16/uint64/string arrays decode instead of falling back to hex. Hex fallback kept for invalid dtypes and truncated buffers.[0, top]; style changes no longer double-render (the 3D renderer defers re-init to the owningShapeRenderer); duplicated source-recovery logic moved to a sharedupdateSourceWithRecovery()helper.🤖 Generated with Claude Code