Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(analytics): generate fallback userToken #5500

Closed

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Feb 23, 2023

Summary

Result

Haroenv and others added 5 commits February 21, 2023 14:23
* feat(insights): automatically load search-insights if not passed

FX-2244

* different wording

* fix(insights): notify of error when insights fails to load

* prettier snippet
To better prepare for the insights middleware being automatically added, we are making the following changes:

- useCookie by default true so userToken does not need to be provided
- still call `insightsClient` if no userToken is found (userToken can be applied using useCookie, thus not known)
- error on unknown algolia credentials converted to warning
FX-2250 

Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com>
@codesandbox-ci
Copy link

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 f107a67:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
example-react-instantsearch-hooks-default-theme Configuration
example-vue-instantsearch-default-theme Configuration

},
});
search.use(insights);
// const insights = instantsearch.middlewares.createInsightsMiddleware({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to revert

Haroenv added a commit that referenced this pull request Feb 27, 2023
This makes sure when the same userToken is set multiple times, it doesn't cause multiple search requests, as could be the case if something would call setUserToken without condition.

Discovered in #5500, but should be merged separately.
Haroenv added a commit that referenced this pull request Feb 28, 2023
This makes sure when the same userToken is set multiple times, it doesn't cause multiple search requests, as could be the case if something would call setUserToken without condition.

Discovered in #5500, but should be merged separately.


Co-authored-by: Fabien Motte <fabien.motte@algolia.com>
@Haroenv Haroenv force-pushed the feat/automatic-insights branch from ad20519 to b6ef7b3 Compare March 2, 2023 10:28
Haroenv added a commit that referenced this pull request Mar 2, 2023
This makes sure when the same userToken is set multiple times, it doesn't cause multiple search requests, as could be the case if something would call setUserToken without condition.

Discovered in #5500, but should be merged separately.

Co-authored-by: Fabien Motte <fabien.motte@algolia.com>
Haroenv added a commit that referenced this pull request Mar 2, 2023
This makes sure when the same userToken is set multiple times, it doesn't cause multiple search requests, as could be the case if something would call setUserToken without condition.

Discovered in #5500, but should be merged separately.

Co-authored-by: Fabien Motte <fabien.motte@algolia.com>
@Haroenv Haroenv force-pushed the feat/automatic-insights branch from b6ef7b3 to 00568aa Compare March 2, 2023 11:17
Haroenv added a commit that referenced this pull request Mar 8, 2023
This makes sure when the same userToken is set multiple times, it doesn't cause multiple search requests, as could be the case if something would call setUserToken without condition.

Discovered in #5500, but should be merged separately.

Co-authored-by: Fabien Motte <fabien.motte@algolia.com>
@Haroenv Haroenv force-pushed the feat/automatic-insights branch from b4e9504 to 7f415a8 Compare March 8, 2023 16:00
@sarahdayan
Copy link
Member

With the RFC on decoupling (or using v3) we'll likely not need this. Should we close @Haroenv?

@Haroenv Haroenv closed this Apr 7, 2023
@Haroenv Haroenv deleted the fix/automatic-insights-default-token branch April 7, 2023 14:09
Haroenv added a commit that referenced this pull request Apr 18, 2023
This makes sure when the same userToken is set multiple times, it doesn't cause multiple search requests, as could be the case if something would call setUserToken without condition.

Discovered in #5500, but should be merged separately.

Co-authored-by: Fabien Motte <fabien.motte@algolia.com>
Haroenv added a commit that referenced this pull request Apr 24, 2023
This makes sure when the same userToken is set multiple times, it doesn't cause multiple search requests, as could be the case if something would call setUserToken without condition.

Discovered in #5500, but should be merged separately.

Co-authored-by: Fabien Motte <fabien.motte@algolia.com>
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