Skip to content

fix: correct autocomplete session tokens - #3

Closed
Ayush Neekhar (ayushneekhar) wants to merge 1 commit into
Rippling:masterfrom
ayushneekhar:fix-autocomplete-session-tokens
Closed

Ayush Neekhar (ayushneekhar) wants to merge 1 commit into
Rippling:masterfrom
ayushneekhar:fix-autocomplete-session-tokens

Conversation

@ayushneekhar

Copy link
Copy Markdown

What changed

  • Reuse one autocomplete session token across prediction requests.
  • Pass the same token to the selected Place Details request.
  • Clear the session after selection.
  • Expose resetAutocompleteSession() for searches dismissed without a selection.
  • Document the custom autocomplete session lifecycle.

Why

The native bridges created a fresh token for every prediction and omitted it from Place Details. Google therefore treated prediction requests as autocomplete sessions without Place Details and billed them separately instead of associating them with the selected place.

Google's guidance requires one token for the complete interaction and the same token on the terminating Place Details request:

Validation

  • git diff --check
  • node --check index.js
  • npm pack --dry-run --cache /private/tmp/codex-react-native-google-places-npm-cache

This repository has no automated native test harness. Consumers will need a newly published package version before removing any temporary local patch.

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