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
Bug 1907863: Update quick start actions to handle concurrent state updates #7553
Bug 1907863: Update quick start actions to handle concurrent state updates #7553
Conversation
@rohitkrai03: This pull request references Bugzilla bug 1907863, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
@rohitkrai03 can we add the sync true to AllQuickStartStates only. This will be helpful if the Quickstarts are open in two different browser tabs.
cfe4536
to
8836578
Compare
@sahil143 Added sync true for all quick start states. |
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.
@sahil143 Fixed. |
8836578
to
80be7ab
Compare
@rohitkrai03 I'm seeing a weird mismatch in the state. Not sure if it's to do with quick start state updates or the userSettings hook itself |
That's actually because |
Ah Okay! That makes sense |
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.
/lgtm
verified changes locally. works as expected
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rohitkrai03, sahil143 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
@rohitkrai03: All pull requests linked via external trackers have merged: Bugzilla bug 1907863 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes: https://issues.redhat.com/browse/ODC-5233
Fixes: https://issues.redhat.com/browse/ODC-5236
Fixes: https://issues.redhat.com/browse/ODC-5268
Analysis / Root cause: While moving from local storage to use settings the quick start state was moved from redux to top level context using context provider extension. The quick start state is very complex and require concurrent update to the state for each user action, that is why there were multiple calls to
setState((state) => newState)
which resulted in each call working with the older and stale state. this resulted in none of the quick start actions working correctly.Solution Description: There were two possible solutions for the above problem -
redux
oruseReducer
for managing state of quick start. The problem with this approach is that theinitialState
of the reducer needs to be async coming from user settings. One way to solve this was to have a separate action just to initialize the state asynchronously but not sure if this is a widely accepted pattern for doing such things.Went ahead with the second approach for now as that required less changes to the current code.
Screen shots / Gifs for design review:
Browser conformance: