Skip to content

Fix sample flight: Replace BA1 with BA175 + Critical bug fixes - #7

Open
kush2shah wants to merge 2 commits into
mainfrom
fix-sample-flight-ba175
Open

Fix sample flight: Replace BA1 with BA175 + Critical bug fixes#7
kush2shah wants to merge 2 commits into
mainfrom
fix-sample-flight-ba175

Conversation

@kush2shah

Copy link
Copy Markdown
Owner

Summary

  • Replace BA1 with BA175 in sample flights for better reliability
  • Fix critical oceanic coordinate parsing bug that was causing app crashes
  • Fix compilation errors from optional destination handling

Changes

Sample Flight Fix

  • Updated PopularRouteStore.swift to use BA175 instead of BA1
  • BA1 was returning position-only flights to Langley AFB instead of expected commercial service
  • BA175 is British Airways' actual daily LHR-JFK transatlantic service

Critical Bug Fixes

  • Coordinate Parsing: Fixed DDMM format parsing (0649N08043E → 6.816°N, 80.716°E)
  • JSON Decoding: Made destination optional to handle position-only flights
  • UI Safety: Updated all destination references to handle optionals safely
  • MapKit Crashes: Prevents invalid coordinate crashes outside ±90°/±180° bounds

Testing

  • Verified BA175 returns proper commercial flight data
  • App no longer crashes on oceanic coordinate parsing
  • All sample flights now work reliably

🤖 Generated with Claude Code

kush2shah and others added 2 commits August 25, 2025 00:29
BA1 was returning position-only flights to Langley AFB instead of the expected LHR-JFK commercial service. BA175 is British Airways' actual daily transatlantic service.

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

Co-Authored-By: Claude <noreply@anthropic.com>
COORDINATE PARSING FIX:
- Fixed regex pattern parsing that was treating DDMM coordinates as plain integers
- Now properly parses both "0649N08043E" and "4100N/06000W" formats
- Converts DDMM to decimal degrees: 0649 = 06°49' = 6.816° (not 649°)
- Prevents MapKit crashes from invalid coordinates outside ±90°/±180° bounds

COMPILATION FIXES:
- Made destination field optional in AeroFlight model to handle position-only flights
- Added filter to exclude flights without destinations from API responses
- Updated all UI references to safely unwrap optional destinations
- Prevents crashes from null destination fields in flight data

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

Co-Authored-By: Claude <noreply@anthropic.com>
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