-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid routes to be overwritten when set in the store
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 (#314)
- Loading branch information
Showing
7 changed files
with
173 additions
and
235 deletions.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.