-
Notifications
You must be signed in to change notification settings - Fork 54
[Affiliate] Update banner closed state across tabs #1875
Conversation
|
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.
Working like a charm.
Only 1 minor comment
Hey @ramirotw , great job!
Could you please take a look into this issue? |
@elena-zh please re-test, that case should be handled. Thanks! |
Hey @ramirotw , changes LGTM! I'm not sure if it is an issue, though... 🙃 |
Good to point that out. That's because of redux and the middleware that saves redux state in local storage. When you clear the app data through the |
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.
Thanks!
Summary
Closes #1818 #1812
This PR handles the case where the user has multiple tabs of the app and the Affiliate banner is closed in one tab. The state now is reflected across all the tabs.
There was a race condition happening as seen in Elena's recording due to how the redux state is updated and also because of the redux-localstorage-simple middleware. Background: the global state in memory is persisted in local storage within each second when there's an action dispatched, if the user has multiple tabs opened, it can happen than one tab updates its global state and hence local storage after 1 second, then the user switch tabs and the other app instance had an old state in memory, which after another second updates local storage overriding the previous (and newer) state.
To Test