Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(middleware): subscribe middleware before initializing main index #4849
fix(middleware): subscribe middleware before initializing main index #4849
Changes from all commits
acefc75
0c97b55
ba1bb13
25f41b2
41313a6
a291384
ec13e38
6cb604c
e350d7b
aea83ee
289c518
ea56a5f
8e4269b
6fba77c
0fbcdcf
321b952
4066caf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically a breaking change, but I don't think it will break anything in real life.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've got a customer report saying that their app broke. I think that's because of this commit, because
instantSearchInstance.renderState[instantSearchInstance.indexName]
is undefined increateInsightsMiddleware
.Any middleware that relies on
instantSearchInstance
might break now, because there's no certainty that the instance has started anymore.Could we rather have a
setInitialUiState
method which updatesinitialUiState
without these PR changes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually fixed that regression at #4897
I tried to fix the issue without introducing new API, but I let you and the team decide whether to revert #4849 and #4897 and introduce
setInitialUiState
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The insights middleware used to rely on the helper to set/get user token. However, now that we get this
subscribe()
called beforemainIndex.init()
we no longer have access to the helper at subscribe(). We could setTimeout(fn, 0) but it will make the first query being fired without user token.Anyway I don't like touching helper directly here, so changed the implementation to create a custom configure widget within the middleware to manipulate the search parameters.