-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: fix problem with redirecting to desktop #60487
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: fix problem with redirecting to desktop #60487
Conversation
@hoangzinh 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] |
Hi @koko57, I recall in above step, App should show magic code in Web, shouldn't it? |
@hoangzinh no for dev it shows logged in account ![]() this works that way even without the changes |
@@ -35,16 +35,24 @@ function promptToOpenInDesktopApp(initialUrl = '') { | |||
} else { | |||
// Match any magic link (/v/<account id>/<6 digit code>) | |||
const isMagicLink = CONST.REGEX.ROUTES.VALIDATE_LOGIN.test(window.location.pathname); | |||
const shouldAuthenticateWithCurrentAccount = isMagicLink && !!currentUserAccountID && window.location.pathname.includes(currentUserAccountID.toString()); |
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.
const shouldAuthenticateWithCurrentAccount = isMagicLink && !!currentUserAccountID && window.location.pathname.includes(currentUserAccountID.toString()); | |
const shouldAuthenticateWithCurrentAccount = !isMagicLink || !!currentUserAccountID && window.location.pathname.includes(currentUserAccountID.toString()); |
I'm considering do we have any regression with current condition. Previously, it was always be true if it's not a magic link.
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.
ok, you're right - but I will do it slightly different way -
const shouldAuthenticateWithCurrentAccount = !isMagicLink || (isMagicLink && !!currentUserAccountID && window.location.pathname.includes(currentUserAccountID.toString()));
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-04-24.at.20.54.59.movAndroid: mWeb ChromeScreen.Recording.2025-04-24.at.20.46.30.moviOS: NativeScreen.Recording.2025-04-24.at.20.40.50.ios.moviOS: mWeb SafariScreen.Recording.2025-04-24.at.20.43.23.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-04-24.at.20.05.00.web.movMacOS: DesktopScreen.Recording.2025-04-24.at.19.48.57.desktop.mov |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #20121 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
Hi @koko57, nice work here. Before moving on would you be able to look further into this potential |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊 (1/8)Significant Changes To Duration
Show details
|
Performance Comparison Report 📊 (2/8)Meaningless Changes To Duration (1/7)Show entries
Show details
|
Performance Comparison Report 📊 (3/8)Meaningless Changes To Duration (2/7)Show entries
Show details
|
Performance Comparison Report 📊 (4/8)Meaningless Changes To Duration (3/7)Show entries
Show details
|
Performance Comparison Report 📊 (5/8)Meaningless Changes To Duration (4/7)Show entries
Show details
|
Performance Comparison Report 📊 (6/8)Meaningless Changes To Duration (5/7)Show entries
Show details
|
Performance Comparison Report 📊 (7/8)Meaningless Changes To Duration (6/7)Show entries
Show details
|
Performance Comparison Report 📊 (8/8)Meaningless Changes To Duration (7/7)Show entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
@Julesssss I'm ooo right now and I'll be back 5th of May so I can look into this when I'm back. |
Great, thank you. Issue here. I hope you don't read this until back from OOO! |
@Julesssss can you assign me to that issue too? I'm happy to review it |
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.1.33-0 🚀
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.1.35-1 🚀
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.1.36-3 🚀
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.1.37-1 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.1.37-3 🚀
|
Explanation of Change
Fixed Issues
$ #20121
PROPOSAL: #20121 (comment)
Tests
PREREQUISITES: for testing on dev you need to comment out this line of code:
App/src/components/DeeplinkWrapper/index.website.tsx
Line 86 in 92707c3
For easier testing you can use chrome extension: REDIRECTOR properly configured to be able to click the Magic Link and being redirected to dev/staging without the need to copy/paste and change the URL
CASE 1 - user is logged out on web and desktop
CASE 2 - user logged in on web, logging in with the same account on desktop
CASE 3 - user logged in on web (User A), logging in with a different account (User B) on the desktop
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-04-17.at.17.40.24.mp4
Screen.Recording.2025-04-17.at.17.39.26.mp4
Screen.Recording.2025-04-17.at.17.38.32.mp4
MacOS: Desktop