-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[WIP] Fix findAncestor's parentDepth parameter usage
#8765
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
Closed
Closed
Conversation
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
guizmaii
commented
Apr 19, 2024
| if (childValue == ref.initial) parentFiberRefs | ||
| parentFiberRefs.getOrElse(ref, null) match { | ||
| case null => | ||
| if (childValue == initialValue) parentFiberRefs |
Member
Author
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 wonder what it means to compare this childStack.head.value with this ref.initial 🤔
e12d82a to
926d7c1
Compare
Member
|
Definitely need a test to codify behavior. |
926d7c1 to
1fd4be9
Compare
findAncestor's parentDepth parameter usagefindAncestor's parentDepth parameter usage
1fd4be9 to
a780081
Compare
guizmaii
added a commit
to guizmaii/zio
that referenced
this pull request
Apr 22, 2024
…rRefs` stack implementation
Closed
1 task
Member
Author
|
Superseded by #8779 |
guizmaii
added a commit
to guizmaii/zio
that referenced
this pull request
Apr 23, 2024
…rRefs` stack implementation
guizmaii
added a commit
to guizmaii/zio
that referenced
this pull request
Apr 26, 2024
…rRefs` stack implementation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Supersed #8748 (It was easier to create a new PR than to rebase)
The issue this PR is exploring is the following (copy of the original comment where we discovered it):
There's something surprising in this function.
In the previous version of the code, the
parenthDepthparameter seems to be misspelled, and so never used 🤔The
parentDepthvariable, which is ("correctly spelled" and) used in the algorithm is always the one from the.fold(...) { case Value(parentStack, parentDepth) => ... }context, so is constant.This means that the recursive calls to
findAncestor, when weparentDepth - 1, is always using the same value forparentDepth - 1. No matter how many recursive calls are made, the result ofparentDepth - 1will always be the same 🤔I'm not quite sure what this algo is doing nor what should be the correct value used in this subtraction 🤔
The issue I have with my change is that it probably changes a behaviour without breaking any test.
It means that:
🤔
If we consider this new behaviour correct, it would probably be interesting to add a test to validate and "protect" it from future mistake/incorrect evolution