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(insights): use getUserToken method instead of _get #4744

Merged
merged 2 commits into from
Apr 21, 2021

Conversation

eunjae-lee
Copy link
Contributor

Summary

This PR replaces _get with getUserToken. At the time of writing the insights middleware, I wasn't aware of getUserToken method.

Result

It works the same.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 20, 2021

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

Sandbox Source
InstantSearch.js Configuration

@@ -86,25 +86,6 @@ describe('insights', () => {
});

describe('initialize', () => {
it('initialize insightsClient', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is redundant. We do not need _hasCredentials anywhere in search-insights or InstantSearch.js. (The test may have been added to see the possibility of avoiding duplicated init calls, but it's taken care in another PR.)

@eunjae-lee eunjae-lee requested review from a team, tkrugg and shortcuts and removed request for a team April 20, 2021 14:52
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

do we need to check that the insights client is at least version 1.2.0? I'm not sure if it's possible, since there's no method to get the version. since that version is pretty old, I think it's ok to use it here

EDIT: question irrelevant, getUserToken is older than _get

@eunjae-lee eunjae-lee merged commit 05d05a9 into master Apr 21, 2021
@eunjae-lee eunjae-lee deleted the fix/get-user-token branch April 21, 2021 08:20
Haroenv pushed a commit that referenced this pull request Apr 30, 2021
* fix(insights): use getUserToken method instead of _get

* fix test cases
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.

None yet

3 participants