Skip to content

fix: coordinates at lat=0 or lon=0 silently rejected#732

Merged
accius merged 3 commits intoaccius:Stagingfrom
ceotjoe:fix/coordinate-zero-value
Mar 15, 2026
Merged

fix: coordinates at lat=0 or lon=0 silently rejected#732
accius merged 3 commits intoaccius:Stagingfrom
ceotjoe:fix/coordinate-zero-value

Conversation

@ceotjoe
Copy link
Contributor

@ceotjoe ceotjoe commented Mar 14, 2026

What does this PR do?

Fixes #729. JavaScript's truthy check treats 0 as falsy, causing valid coordinates on the equator (lat=0) or prime meridian (lon=0) to be ignored as if missing.

  • Replace all if (lat && lon) / if (!lat || !lon) guards with explicit != null / == null checks across 9 files (18 occurrences total)
  • Affected areas: DX location restore from localStorage, weather fetching, grid square calculation, map spot rendering (WorldMap, AzimuthalMap), PSK Reporter UI, lightning layer

Test plan

  • Set DE or DX location to lat=0 or lon=0 and verify it is saved/restored correctly
  • Confirm weather loads for a location on the equator or prime meridian
  • Confirm spots at lat=0 or lon=0 appear on WorldMap and AzimuthalMap
  • Verify grid square calculates correctly when lat or lon is 0

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor / code cleanup
  • Documentation
  • Translation
  • Map layer plugin

Checklist

  • App loads without console errors
  • Tested in Dark, Light, and Retro themes
  • Responsive at different screen sizes (desktop + mobile)
  • If touching server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)
  • If adding an API route: includes caching and error handling
  • If adding a panel: wired into Modern, Classic, and Dockable layouts
  • No hardcoded colors — uses CSS variables (var(--accent-cyan), etc.)
  • No .bak, .old, console.log debug lines, or test scripts included

ceotjoe and others added 3 commits March 14, 2026 22:22
Replaces truthy guards (if lat && lon) with explicit null checks
(lat != null) so coordinates on the equator or prime meridian are
no longer silently rejected. Fixes accius#729.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ightning

Applies the same null-check correction from accius#729 to three additional
files not covered by the original report. Spots and DE locations at
lat=0 or lon=0 now render correctly on all map views.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Missed instance from accius#729 — decodes at the equator or prime meridian
were being filtered out before reaching the map.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ceotjoe ceotjoe marked this pull request as ready for review March 14, 2026 21:56
@alanhargreaves
Copy link
Contributor

Good catch.

@accius
Copy link
Owner

accius commented Mar 15, 2026

nice work

@accius accius merged commit a92062e into accius:Staging Mar 15, 2026
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.

3 participants