Fixed bug in dependency deletion.#2421
Open
MaximumCookie wants to merge 1 commit intojonataslaw:masterfrom
Open
Fixed bug in dependency deletion.#2421MaximumCookie wants to merge 1 commit intojonataslaw:masterfrom
MaximumCookie wants to merge 1 commit intojonataslaw:masterfrom
Conversation
Before the Binding creates dependencies for a new route, the dependencies from the old route are marked as "dirty". However, if the new route adds one of those same dependencies, then the dirty dependency is moved to the 'lateRemove' property and the root dependency is no longer marked 'isDirty'. This means, when Get.delete() is eventually called on the dependency, the newly created dependency gets deleted instead of the old one. However, before that delete occurs, the new dependency is already in use by the new page which is likely to cause problems.
Owner
|
Wow, thanks for that. Looks like you're right. |
Mihai-B
approved these changes
Jun 27, 2022
|
I would like to know when this merge will be released. |
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 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.
Before the Binding creates dependencies for a new route, the dependencies from the old route are marked as "dirty". However, if the new route adds one of those same dependencies, then the dirty dependency is moved to the 'lateRemove' property and the root dependency is no longer marked 'isDirty'. This means, when Get.delete() is eventually called on the dependency, the lifecycle 'delete()' is called on the new dependency instead of the old one, and the old dependency ends up being removed from memory (To summarize: The delete() method is called on the wrong controller if both the old and new route have the same controller in their Binding.).
It seems like the delete() lifecycle method should always be called on the same dependency that ends up being removed from memory, which this change fixes.
Every PR must update the corresponding documentation in the
code, and also the readme in english with the following changes.Pre-launch Checklist
///).