-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[CP Staging] Keep original isClientTheLeader value on page refresh #42095
Conversation
@ishpaul777 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
* The last GUID is the most recent GUID, so that should be the leader | ||
*/ | ||
const isClientTheLeader: IsClientTheLeader = () => { | ||
if (wasTheLeader) { |
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.
Can you please add a comment here explaining why this logic is necessary? Maybe a better name for this variable would be isPromotingAnotherLeader
or something.
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.
Fun fact, var name isPromotingAnotherLeader
was triggering eslint rule no-negated-condition
. So I had to use isPromotingNewLeader
is this PR requires me as c+ @tgolen : ) |
Yes, would you please do the checklist for this PR and test it? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeScreen.Recording.2024-05-14.at.4.17.09.AM.moviOS: NativeN/a iOS: mWeb SafariScreen.Recording.2024-05-14.at.3.58.11.AM.movMacOS: Chrome / SafariScreen.Recording.2024-05-14.at.2.29.33.AM.movMacOS: DesktopN/A SINCE ITS NOT POSSIBLE TO OPEN APP ON DIFFERENT TABS ON DESKTOP |
@Skakruk Please add QA steps (should be same as test steps just mention this under QA steps) |
Whats the expected behaviour in case 2 tabs are open in same window, I see "Get started below." on both screens 🤔 |
@ishpaul777 that's correct behavior since once the tab is active, client becomes the leader |
okay this make sense, then what are the specific conditions where we show the screen and why (just want to understand the issue better) |
you may see the bug in related issue #42062 |
okay i get the issue this PR is fixing, but i am asking when do we show "Another login page is open." is it only when the tab is open on different window, say Tab A and Tab B on same window, i open Tab B in different window, Tab A shows "Another login page is open." Am i understanding correctly? is there any case i am missing? Screen.Recording.2024-05-14.at.2.17.37.AM.mov |
also @Skakruk Can you please add demo videos for Andriod chrome and Ios safari |
We don’t have such scenarios for native devices. Also, the code is mocked
for that platforms. It only affects web browsers.
…On Tue, May 14, 2024 at 00:09 Ishpaul Singh ***@***.***> wrote:
also @Skakruk <https://github.com/Skakruk> Can you please add demo videos
for Andriod chrome and Ios safari
—
Reply to this email directly, view it on GitHub
<#42095 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANP3V3NOKLP2DCIK6VAKGLZCETZJAVCNFSM6AAAAABHUWNPV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBYHAYDIMJRGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yeah thats why i asked only for android mweb-chrome and mweb safari video : ) |
// keep reporting currently leading client on page refresh | ||
// when clientID is already removed from activeClients list |
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.
// keep reporting currently leading client on page refresh | |
// when clientID is already removed from activeClients list | |
// When a new leader is being promoted, there is a small period of time when the current leader's clientID has been removed from the activeClients list due to asynchronous operations, but the new leader hasn't officially taken over yet. This can lead to a moment when the page is refreshed where multiple leaders are being reported. This early return here will prevent that from happening by keeping the current leader as the "active leader" until the other leader is fully promoted. |
Please be sure that comments are all proper English and do a thorough job of explaining the purpose of the logic. Also, even though I've added this suggestion, you'll need to split it up into multiple lines (I suggest using our line max length setting for this).
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.
Thank you, I've updated the comment.
@Skakruk Please add videos for mweb chrome and mweb safari its not skipable item in checklist for this case |
@ishpaul777 I've uploaded screen records for iOS Safari and Android Chrome devices |
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.
@ishpaul777 did you want to check off that last item? |
ah sorry, checked it off :D |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
[CP Staging] Keep original isClientTheLeader value on page refresh (cherry picked from commit 8a5bc9c)
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 1.4.73-7 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.73-7 🚀
|
Details
Login - 'Another login page is open' briefly displayed when refresh the page
A bug was caused by this PR #40997. On page refresh, the app was cleaning its own clientID from the list of active clients. And while the page is still visible Onyx reports change and triggers re-render. Since clientID is already removed from the list,
isClientTheLeader
returnsfalse
.Fixed Issues
$ #42062
PROPOSAL: #42062 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: mWeb Chrome
az_recorder_20240514_220249_edited.mp4
iOS: mWeb Safari
RPReplay_Final1715707087.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-05-13.at.21.10.30.mp4