Closed kbecciv closed 1 year ago
Triggered auto assignment to @mallenexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Job added to Upwork: https://www.upwork.com/jobs/~0151b55ece236c38ac
Triggered auto assignment to Contributor Plus for review of internal employee PR - @s77rt (Internal
)
Was able to reproduce, you might not need to do 'all' the steps, maybe try
Reckon this is internal. Refreshing 'fixed' it. I didn't see any errors in the console either
I was able to reproduce too. Unrelated but on staging.new.expensify.com we are not getting redirected to the concierge chat.
Triggered auto assignment to @MariaHCD (Engineering
), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Eeeps, didn't know (or forgot) I also needed to apply Engineering
along with Internal
. @MariaHCD can you take a look plz?
I'm able to reproduce the issue as well. As an additional note, if you're already signed in on Desktop, you get a Session Expired error instead of a loading spinner:
After doing some more testing, I see that the infinite spinner isn't always reproducible, I tested several times and was able to load the desktop app without issues:
So it looks like the "Open in New Expensify" button from web does work (the requests to SignInWithShortLivedAuthToken
and OpenApp
succeed, internal logs here) but seems to fail when you've just newly/recently logged into your account on OldDot.
I did notice that when the infinite spinner was shown on desktop, the requests to SignInWithShortLivedAuthToken
and OpenApp
were not sent:
So that makes me think that perhaps the App is not sending those requests when opened from web. In this case, I think this can be an external issue.
Current assignee @mallenexpensify is eligible for the External assigner, not assigning anyone new.
Current assignee @s77rt is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to @pecanoro (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Upwork job price has been updated to $2000
I did a quick-double here on the price as I'd like to see this solved well-before ExpensiCon which is weeks away. We don't want attendees clicking links and getting spinners
Desktop - App is show endless spinner when tap popup Open app in "New Expensify
The root cause is we haven't removed the "/transition" route from history in this case => it causes us get stuck with loading indicator in page LogOutPreviousUserPage. More details (in case Desktop App is not logged with any user):
We have solved this problem in several places. Ie here 1 or here 2
We can apply same logic after API signInWithShortLivedAuthToken called (after this line). More details:
Looks like something related to react-navigation
may have been mentioned in this issue discussion.
As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js
files should not be accepted.
Feel free to drop a note in #expensify-open-source with any questions.
@hoangzinh Thanks for the proposal. I don't think your RCA is entirely correct LogOutPreviousUserPage
indeed does not perform any navigation so we are as you said stuck. But I think it's by design not to perform navigation as the purpose of that component is to solely to handle user session. The navigation is handled by setUpPoliciesAndNavigate.
I think the bug is a regression from https://github.com/Expensify/App/pull/16043. That PR adds the /transition
prefix to all deeplinks.
That means setUpPoliciesAndNavigate will redirect us to another transition page which will only show the loader.
Refreshing the page works because we are refreshing the new transition url which contains the correct exitTo
path (cc @mallenexpensify https://github.com/Expensify/App/issues/17391#issuecomment-1507715567).
It may be obvious to simply not to add the transition prefix if the url already starts with that, but I think something is wrong with that PR, raised the concern here https://github.com/Expensify/App/pull/16043#issuecomment-1512468210.
@s77rt you're right. I got noticed in the exitTo request param is weird during investigation and look into how it's built in above PR. But I thought it's another issue.
@s77rt will we let the author of this PR fix or I need to update my proposal again?
@s77rt , thanks for the breakdown above, it makes more sense to me now.
@hoangzinh Feel free to update your proposal. But I think it may be better to revert the PR since it was build on a wrong concept; The /transition
root is for OLDDOT -> NEWDOT and not for WEB -> DESKTOP.
cc @pecanoro @tgolen @hayata-suenaga @thesahindia Need some help here since you reviewed that PR.
@ntdiary do you also have idea how to solve this as you're touching the same area?
The original author created another PR to clean up the faulty PR: here. @ntdiary do you think that PR will solve this regression as well?
The original author created another PR to clean up the faulty PR: https://github.com/Expensify/App/pull/17452. @ntdiary do you think that PR will solve this regression as well?
@pecanoro, actually, I don't think it will. And as for this issue, I don't think it's a regression from #16043.
Here are related PRs:
@ntdiary do you also have idea how to solve this as you're touching the same area?
@hayata-suenaga, yeah. Like before PR #17452, when we open NewDot from OldDot, the popup window doesn't appear. Before:
IMO, when opening NewDot from OldDot, we need to confirm whether the popup should appear or not. How many similar cases are there, and do they all need to display the popup window?
If not, we should exclude these links(e.g./transition
url) in the deep link component.
If yes, and if these cases need to log in with short-lived auth token first, then we should display the popup window after the login is complete.
Just for this issue, we can exclude /transition
url and then display the popup window in the setUpPoliciesAndNavigate
:
the demo code may be like this:
It might be easier to fix this after PR #17452 and #17364 are merged.
@ntdiary I think it's a regression from that PR because only that PR adds the /transition
prefix which breaks all desktop deeplinks for olddot links. Are you planning to remove that prefix? I don't think we should use it since it's not intended for desktop deeplinks but only for olddot to newdot transition.
@ntdiary I think it's a regression from that PR because only that PR adds the /transition prefix which breaks all desktop deeplinks for olddot links. Are you planning to remove that prefix? I don't think we should use it since it's not intended for desktop deeplinks but only for olddot to newdot transition.
@s77rt, no, we have a plan to create a new BeginDeepLinkRedirect
command.
Why are you think it's a regression? Or am I understanding the definition of regression wrong?
The related feature was never implemented, and removing it won't help fix this issue. Or you think we should use another way to sync the user session between web app and desktop app?
@ntdiary I think the timeline is a bit confusing :sweat_smile:. All what I'm trying to say is if that PR never existed the bug would not occur. You can try do the following:
In such cases where:
I'm only against the idea of using one thing for two different things. The /transition root has nothing to do with deeplinks. If we can keep the same logic but use a dedicated root for WEB -> DESKTOP that would be better. But that's just my personal opinion. Whatever the team sees as a better fit works for me.
I hope my concerns are clear here :+1:
agree with @s77rt. If we want to use existing one, we have to ensure it won't break the old flow (unfortunately, it only reveal with PR2). But even it won't break the old flow, the name of route makes confusing for us, ROUTES.TRANSITION_FROM_OLD_DOT
but using also for open deep links WEB -> DESKTOP.
agree again with @s77rt, the quick fix is having a dedicated route for open deep links.
@s77rt, Thanks a lot for your detailed explanation. I don't think we can guarantee that a PR can be fully responsible for future breaking changes.
As for oldDot --> newDot and Web --> Desktop. They are both essentially trying to sync the the user session between the two systems and are highly similar. I think what we actually need to solve is to pass a correct link to the desktop app, adding a route doesn't help the problem. And if the name of route makes confusing for us, we could also consider changing its name to avoid confusion. Maybe here we need more inputs from the team.
One more thing, I only remember that the short-lived auth token is valid for 1 minute, but I don't remember whether it has limited its sign-in times. Although in my past experience, a temporary token should only be verified once for security reasons, but from your case above, it seems that it can be used to sign in repeatedly within 1 minute.
@ntdiary I understand your point. I just want to clear the ambiguity. At this current state if you navigate code you may find isTransitioningFromOldDot
being true but it's actually not, we are not transitioning from old dot, but probably from a deeplink. If simply changing the names would be enough, let's do it.
Or we can break this up into two parts:
For deeplinks we go through sync process. For old dot transition we go through the transition process that under the hood makes use of the sync process.
Or we can break this up into two parts:
- Sync process
- Transition process
For deeplinks we go through sync process. For old dot transition we go through the transition process that under the hood makes use of the sync process.
@s77rt, sorry, I'm afraid I haven't fully understood this part. Could you please explain in more detail what the new sync process and new transition process will do? Or what is the difference between them and the existing logic?
AFAIK, the transition page is responsible for the sync of the user session, and the App.setUpPoliciesAndNavigate
is responsible for the navigation. These two parts (sync and navigation) are needed whether opening newDot from oldDot or opening desktop app from web app. And thank you for your thoughts on these issues. I think we will definitely reach a consensus and have a good solution in the end. 🍻
@ntdiary Thanks for the quick follow up. If the deeplink process and the transition process are identical then we can just rename the variables to reflect that.
So the change will only revolve around clearing the comments and changing variable names accordingly. Then to fix this issue we can just skip adding the /transition prefix if the url already starts with that.
Does that sound good enough?
@s77rt, that sounds good to me, and it won't be a difficult thing. : )
@pecanoro, @s77rt, @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
@pecanoro @mallenexpensify @tgolen Can you please help move this forward?
I'd prefer doing this as part of cleaning up the deep link code.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Ok, let's assign the issue to @ntdiary so we can handle it as part of https://github.com/Expensify/App/pull/17452
📣 @ntdiary You have been assigned to this job by @pecanoro! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
@ntdiary can you please apply and reply here with your first name once you have? https://www.upwork.com/jobs/~0151b55ece236c38ac
@mallenexpensify, thank you for the reminder. I have applied, my name is wentao
@ntdiary and @s77rt , can you please accept the job when you get a chance?
https://www.upwork.com/jobs/~0151b55ece236c38ac
@mallenexpensify, I have accepted.
I want to confirm again, if the current newDot page is navigated from oldDot, do we really want to show the popup window? Because there is another case to create a workspace, I think if the user opens the desktop app from the popup, the workspace should not be created repeatedly, right?
cc @s77rt
@mallenexpensify Accepted!
@ntdiary Right, it's probably best to exclude non-idempotent call to action buttons.
cc @tgolen
@pecanoro, @ntdiary, @s77rt, @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue. Work is being done on https://github.com/Expensify/App/issues/17987
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when executing PR https://github.com/Expensify/App/pull/16869
Action Performed:
Expected Result:
Desktop App should be open and user login.
Actual Result:
Desktop App is show endless spinner.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.99.4
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://user-images.githubusercontent.com/93399543/231794818-9e4fb26c-ecfb-4945-9586-dd6cf5cbf65b.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mallenexpensify