Repository navigation
fix(desktop): keep impossible coordinates and radii off the lookup wire - #70
Merged
Merged
Conversation
A latitude outside ±90, a longitude outside ±180 or a radius beyond half the Earth's circumference cannot describe a real place; the desktop host already refuses them, so the core now drops such a post's geotag and reports no radius instead of handing the app a value it will reject after the user has paid. Also pins the documented worst case of lookup.activity — six pages, each retried once, twelve requests — with one test.
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.
Two follow-ups from the Lookup reviews.
lookup.activitynow treats a latitude outside ±90, a longitude outside ±180 or a radius beyond 20 100 km the way it already treats a non-finite number: the post's geotag is dropped before the analysis (sogeotagged,places,centroidandradius_kmstay about the same posts) and no radius is reported. The desktop host refuses such values, so before this the app would have turned a paid answer into a protocol error.MAX_PAGE_REQUESTSand the single retry were each proven separately; one test now multiplies them over a realHikerBackendandhttpx.MockTransport: six pages, each failing once, twelve requests,analyzed == 6.ruff, ruff format, mypy clean; pytest 2270 passed (the two
test_symlink_loops_in_a_path_are_home_invalidcases fail the same way on a cleanmainunder Python 3.13).