-
Notifications
You must be signed in to change notification settings - Fork 2
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: avoid routes to be overwritten when set in the store #314
Merged
beawar
merged 5 commits into
devel
from
SHELL-152-sometimes-modules-are-not-shown-inside-primary-bar
Aug 23, 2023
Merged
fix: avoid routes to be overwritten when set in the store #314
beawar
merged 5 commits into
devel
from
SHELL-152-sometimes-modules-are-not-shown-inside-primary-bar
Aug 23, 2023
Conversation
This file contains 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
Sometimes the module are not shown in the primary bar even if they are loaded right. Logging the draft of the addRoute producer, it seems that the order of execution of the addRoute, plus the direct set made by the default views, makes the primary views array lenght change in an unpredictable way. Sometimes happens that the length in the execution n is greater then the lenght in the exectution n+1. This fix aims to avoid this kind of race condition, by registering all the routes (so even the default ones) through the setters provided by the store. In the setters, the curried produce of immer is used to update the store through a direct modification of the draftState. By doing so, there should not present anymore the situation where the state is entirely replaced by an older version of the draft, since the draft is always incrementally updated with the push (to add) and the splice (to remove), and nevere replaced with a direct assignation. refs: SHELL-152
I've created the PR towards release, but it is better to merge it in devel first to follow the usual flow |
…modules-are-not-shown-inside-primary-bar
CataldoMazzilli
previously approved these changes
Aug 21, 2023
…modules-are-not-shown-inside-primary-bar
…r naming refs: SHELL-152
CataldoMazzilli
approved these changes
Aug 21, 2023
nubsthead
approved these changes
Aug 23, 2023
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.
Sometimes the module are not shown in the primary bar even if they are loaded right. By logging the draft of the addRoute producer, it seems that the order of execution of the addRoute, plus the direct set made by the default views, make the primary views array length change in an unpredictable way. Sometimes happens that the length in the execution n is greater than the length in the execution n+1.
This fix aims to avoid this kind of race condition, by registering all the routes (so even the default ones) through the setters provided by the store. In the setters, the curried produce of immer is used to update the store through a direct modification of the draftState. By doing so, there should not be present anymore the situation where the state is entirely replaced by an older version of the draft, since the draft is always incrementally updated with the push (to add) and the splice (to remove), and never replaced with a direct assignation.
refs: SHELL-152