Skip to content

fix: validate latitude/longitude ranges to prevent crash on invalid input (#808)#821

Merged
wilhel1812 merged 1 commit intostagingfrom
issue/808-latitude-paste-crash
May 3, 2026
Merged

fix: validate latitude/longitude ranges to prevent crash on invalid input (#808)#821
wilhel1812 merged 1 commit intostagingfrom
issue/808-latitude-paste-crash

Conversation

@wilhel1812
Copy link
Copy Markdown
Owner

Summary

  • Add coordinate range validation in useMapEditorFormState.ts to reject invalid latitude (-90..90) and longitude (-180..180) values
  • Shows user-friendly error messages instead of crashing when pasting malformed coordinates (e.g., 956894)
  • Added 3 new tests to MapEditorPanel.test.tsx covering invalid lat/lon and malformed paste scenarios

Fixes

Closes #808

Verification

  • npm test passes (480 tests)
  • npm run build succeeds
  • Added TDD tests that fail without the fix, pass with it

@wilhel1812 wilhel1812 merged commit 19d817d into staging May 3, 2026
5 checks passed
@wilhel1812 wilhel1812 deleted the issue/808-latitude-paste-crash branch May 3, 2026 08:20
wilhel1812 added a commit that referenced this pull request May 3, 2026
* Revert "fix: add real-time lat/lon validation to prevent map crash (#808) (#822)"

This reverts commit d105094.

* Revert "fix: validate latitude/longitude ranges to prevent crash on invalid input (#808) (#821)"

This reverts commit 19d817d.

---------

Co-authored-by: wilhel1812 <wilhelm@linksim.link>
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