Fix aircraft track orientation propagation to web frontend #26

Merged
olemd merged 1 commit from fix/issue-23-track-propagation into main 2025-08-25 10:49:56 +02:00
Owner

Fixes issue #23 where aircraft track orientations were not updating properly in the web frontend.

Root Cause

Critical bugs in frontend track rotation detection logic in aircraft-manager.js:

  • Faulty null/undefined handling in track comparisons
  • First track assignments never properly detected
  • Overly sensitive 5° threshold masking real update bugs

Key Fixes

  • Fixed rotation detection logic with proper null/undefined handling
  • Added first track detection for initial heading assignments
  • Increased threshold 5° → 10° to reduce noise
  • Enhanced debugging to track orientation updates
  • Eliminated WebSocket broadcast drops
  • Improved connection stability and error handling

Impact

Aircraft icons will now properly rotate to show correct heading when track data is received from ADS-B sources.

Closes #23

Fixes issue #23 where aircraft track orientations were not updating properly in the web frontend. ## Root Cause Critical bugs in frontend track rotation detection logic in aircraft-manager.js: - Faulty null/undefined handling in track comparisons - First track assignments never properly detected - Overly sensitive 5° threshold masking real update bugs ## Key Fixes - Fixed rotation detection logic with proper null/undefined handling - Added first track detection for initial heading assignments - Increased threshold 5° → 10° to reduce noise - Enhanced debugging to track orientation updates - Eliminated WebSocket broadcast drops - Improved connection stability and error handling ## Impact Aircraft icons will now properly rotate to show correct heading when track data is received from ADS-B sources. Closes #23
This commit addresses issue #23 where aircraft track changes were not
propagating properly to the web frontend. The fixes include:

**Server-side improvements:**
- Enhanced WebSocket broadcast reliability with timeout-based queueing
- Increased broadcast channel buffer size (1000 -> 2000)
- Improved error handling and connection management
- Added write timeouts to prevent slow clients from blocking updates
- Enhanced connection cleanup and ping/pong handling
- Added debug endpoint /api/debug/websocket for troubleshooting
- Relaxed position validation thresholds for better track acceptance

**Frontend improvements:**
- Enhanced WebSocket manager with exponential backoff reconnection
- Improved aircraft position update detection and logging
- Fixed position update logic to always propagate changes to map
- Better coordinate validation and error reporting
- Enhanced debugging with detailed console logging
- Fixed track rotation update thresholds and logic
- Improved marker lifecycle management and cleanup
- Better handling of edge cases in aircraft state transitions

**Key bug fixes:**
- Removed overly aggressive position change detection that blocked updates
- Fixed track rotation sensitivity (5° -> 10° threshold)
- Enhanced coordinate validation to handle null/undefined values
- Improved WebSocket message ordering and processing
- Fixed marker position updates to always propagate to Leaflet

These changes ensure reliable real-time aircraft tracking with proper
position, heading, and altitude updates across multiple data sources.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
olemd merged commit b5210faa96 into main 2025-08-25 10:49:56 +02:00
olemd deleted branch fix/issue-23-track-propagation 2025-08-25 10:49:56 +02:00
Sign in to join this conversation.
No reviewers
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: olemd/skyview#26
No description provided.