Feat/a5 hooks channels - #822
Open
XanderD99 wants to merge 6 commits into
Open
Conversation
A5 was parsed only as an output keyword, so SETHOOK/SETCHAN ... FENCE A5 <cell> never reached the area parser.
A5 is now only ever a search area, so the resolution-vs-cell guess is gone.
Hex-parseable ids like "1" carry no resolution marker and reached a5-go with a negative resolution, crashing the server from any client.
Contributor
Author
|
Good call — reworked to use the existing format convention instead of guessing.
Two things fell out while testing it:
|
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.
Please ensure you adhere to every item in this list
Describe your changes
Follow-up to the A5 index (#817):
A5is both an output keyword (A5 <resolution>, likeHASHES) and a search area keyword (A5 <cell>, likeHASH). The output parser always won, so the cell ID was consumed as a resolution andA5 <cell>never reached the area parser:INTERSECTS key A5 <cell>failed the same way — only the workaround of naming an output first (IDS A5 <cell>) worked.Fixed in
parseSearchScanBaseTokensusing the same lookaheadBOUNDSalready uses for its identical collision: onWITHIN/INTERSECTS, if the token afterA5isn't a valid resolution (0–30), it's a cell ID, soA5is left to the area parser.SETHOOK/SETCHANroute through the same function, so hooks and channels are covered by the one change.Also added the A5 case to
parseArea, soTEST ... A5 <cell>works alongsideHASH/QUADKEY/TILE.CLIPis rejected there, since a pentagon isn't a rectangle.Tests: channel and webhook fences over an A5 cell (enter/inside/exit/outside, plus
"a5"in the message when the output form is used),SETCHAN/SETHOOKparsing with and without an output,CHANS/HOOKSround-trip, error cases, an AOF-replay test since the stored fence command is re-parsed on restart, andTESTcoverage matching the existingQUADKEYcases. All fail without the changes.Issue number and link
#817 — #817