Sync upstream: derive LocationType from the primary Google type for keyword searches - #4
Merged
Merged
Conversation
Keyword (brand) searches query Google with LocationTypeAny, so
parsePlacesSearchResponse stamped every result with LocationType "".
The write path is a blind upsert into the shared placeDetails:{id}
records that category reads hydrate from, so each brand search wiped
the type off previously typed records — a McDonald's cached by an
Eatery search was then served with no type, and downstream consumers
(OfferBee best-card) scored it at base rate instead of dining.
Two changes, both gap-filling only:
- parsePlacesSearchResponse: when the searched type is LocationTypeAny,
derive LocationType from POI.PrimaryLocationType(place.Types) — the
same machinery ReclassifyForCategory already uses on category reads.
Typed searches keep their searched-type stamp.
- restoreCachedDetails: restore the stored LocationType when the
rebuilt record has none, same "fill a gap, never overwrite" rule as
URL/Summary/Address/Hours.
Existing blank-typed records stay blank until a fresh search rewrites
them; this stops new wipes and types new keyword results at the source.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BmBJ2x6b7V36vywSMrYDy
…rch-location-type Derive LocationType from the primary Google type for keyword searches
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughSearch results now derive meaningful location types for brand searches. Cached location types restore only missing values. Tests cover derivation, typed searches, untyped results, and preservation of fresh types. ChangesLocation type handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Ronnie434
approved these changes
Aug 12, 2026
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.
Brings timwangmusic/Vacation-Planner#452 down into this fork.
upstream/masterwas exactly two commits ahead ofmain— that PR's change and its merge commit — so this closes the whole gap.What it fixes
Keyword (brand) searches query Google with
LocationTypeAny, soparsePlacesSearchResponsestamped every result with an emptyLocationType. The write path is a blind upsert into the sharedplaceDetails:{id}records that category reads hydrate from, so each brand search wiped the type off previously typed records. A McDonald's cached by an Eatery search was then served with no type, and OfferBee's best-card scoring gave it the base rate instead of dining.The fix derives
LocationTypefromPOI.PrimaryLocationType(place.Types)when the searched type isLocationTypeAny, reusing the machineryReclassifyForCategoryalready applies on category reads. Typed searches keep their searched-type stamp.Touches
iowrappers/nearby_search.goandiowrappers/nearby_search_test.goonly — 83 insertions, no deletions.Why a merge rather than a cherry-pick
This preserves upstream's SHAs. Cherry-picking would give the same change a new SHA here, and every later
origin/main..upstream/mastercomparison would keep reportingb28a678as missing.No conflicts: this fork's commits ahead of upstream are the Apple Maps SDK (#1) and the CI workflow change (#2), which touch
applemaps/,.github/workflows/, and docs — no overlap with the merged files.Verification
go build ./... && go vet ./... && go test ./...clean, including the 72 lines of new tests the upstream commit brings.🤖 Generated with Claude Code
https://claude.ai/code/session_015WGSuRPA8YK814rwbCpStj
Summary by CodeRabbit