Skip to content

Fix Google Places text search: switch to locationBias, add request/response logging#141

Merged
asim merged 2 commits intomainfrom
copilot/fix-api-call-filtering
Feb 24, 2026
Merged

Fix Google Places text search: switch to locationBias, add request/response logging#141
asim merged 2 commits intomainfrom
copilot/fix-api-call-filtering

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Text search calls to Google Places API (New) were returning 400s due to locationRestriction + circle being invalid for :searchText — only :searchNearby supports that combination. This was silently dropping all text search results (e.g. cafe searches). Additionally, API call logging lacked request/response bodies, making debugging opaque.

Changes

  • places/google.go: Switch googleSearch from locationRestriction to locationBias for :searchText. Capture and pass request/response body strings to RecordAPICall.
  • app/apilog.go: Add RequestBody/ResponseBody fields to APILogEntry; extend RecordAPICall signature to accept them.
  • weather/google.go: Update RecordAPICall callers to pass empty strings (GET, no body).
  • admin/api_log.go: Render collapsible <details>/<summary> rows per log entry to expose request/response payloads inline.
// Before (invalid for :searchText — causes 400)
"locationRestriction": { "circle": { ... } }

// After (correct for :searchText)
"locationBias": { "circle": { ... } }

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@asim asim marked this pull request as ready for review February 24, 2026 11:33
…e body logging

Co-authored-by: asim <17530+asim@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing results from local API calls Fix Google Places text search: switch to locationBias, add request/response logging Feb 24, 2026
@asim asim merged commit 64e2a82 into main Feb 24, 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.

2 participants