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 resolver resolution status key types mismatch causing unwanted resolver calls for identical state data #52120
Fix resolver resolution status key types mismatch causing unwanted resolver calls for identical state data #52120
Changes from all commits
6bcec6e
9f8f093
355ee98
b0598a2
99419ce
82352d7
49eea82
f569a98
cd31934
775f32b
240075b
f9a3fb7
728b5f7
3c43549
4c5aa43
959fe56
7aa49ed
3965284
54d76c7
0d5856e
7683ab3
7b4cdfb
6702752
be322a4
c178aa5
f375fd7
d4899d2
9ad9744
4598fa0
3a1dbb5
2c5dc7a
b0b5b45
5d2c7b3
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 will not work with private selectors.
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.
I knew it. The complexity of the code was a clue. Having to jump through so many hoops.
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.
Looking at this again. I don't yet understand why it doesn't work for private selectors.
First step would be writing a test that fails based on what @jsnajdr said above.
With that in place we can fix for private selectors.
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.
I wish this code could be moved into the affected metadata selectors themselves. Actually the only one that needs the normalization is
getResolutionState
.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.
One idea: the metadata selectors and the
metadata
state are private, not exposed in any public API, so we can change their parameters. As state, we could pass an object like:The
bindMetadataSelector
function has access to all registered selectors, their names andnormalizeArgs
functions. So, it can implement thenormalizeArgs
helper as:and
getResolutionState
can be implemented as: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 might be a "simpler" approach. I'll take a look.
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.
Looking here against. The complexity still exists in the
bindMetadataSelector
but we're just making thegetResolutionState
aware of the complexity as well.I'm probably missing something but I'd like to understand more before I proceed with further refactor.