fix(new-widget-builder-experience): Add queries to handleBlur dependency list#33260
Merged
narsaynorath merged 2 commits intomasterfrom Apr 4, 2022
Conversation
The handleBlur has a dependency on queries, which was not updating when the query length would change. This stale data meant that there could be an indexing issue that malforms our query structure, leading to a validation bug
edwardgou-sentry
approved these changes
Apr 4, 2022
Contributor
edwardgou-sentry
left a comment
There was a problem hiding this comment.
LGTM, also confirmed it fixes the undefined reference issue.
Member
|
Thanks for fixing it @narsaynorath 🌮 |
| } | ||
| }; | ||
| }, | ||
| [queries] |
Member
There was a problem hiding this comment.
oh that was the queries... funny, I would have fixed this in the PR #33241
Member
There was a problem hiding this comment.
we have to do the same with handleSearch 😉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The handleBlur has a dependency on queries, which was not updating
when the query length would change. This stale data meant that there
could be an indexing issue that malforms our query structure, leading to
a validation bug
The problem is that the
useCallbackhook doesn't update thequerieslist properly when it updates (either when the widget builder re-renders and fills with data, or when starting fresh and adding fields), leading to thequeries[queryIndex]index to return undefined, which wipes out a bunch of expected fields. The solution is to passqueriestouseCallbackso it updates.Fixes #33236