Skip to content

Conversation

@dhayab
Copy link
Member

@dhayab dhayab commented May 2, 2023

This PR fixes an issue that occurs when the Insights plugin tries to determine whether a source item is coming from Algolia or not, to prepare an Insights event if necessary.

When an Algolia index is configured to restrict the fields returned from the API (with responseFields) and doesn't return the index property, our code falsely assumes that the item is not coming from Algolia, so it doesn't have an Insights payload generated.

Because we know at query time which index we are targeting, we can at response time resolve this issue by retrieving the index name from the list of queries as a fallback.

@dhayab dhayab requested review from a team, FabienMotte and Haroenv and removed request for a team May 2, 2023 09:27
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 2, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit cdff0d6:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration

@dhayab dhayab merged commit 8406eb2 into next May 2, 2023
@dhayab dhayab deleted the fix/insights-indexname-missing-in-response branch May 2, 2023 11:46
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.

4 participants