Skip to content
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

[$250] iOS - Onboarding task deeplinks used within the app redirect users to the web #46495

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 30, 2024 · 54 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 30, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.14
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Issue found when executing PR #46082

Action Performed:

  1. Open the iOS app
  2. Create a new account (please use a public domain)
  3. In the onboarding modal, select "manage my team's expenses"
  4. Go to Expensify chat to view the task checklist
  5. Open a task that contains a deeplink (e.g., meet your setup specialist or set up categories)
  6. Open the desired task and tap on the hyperlink present within the steps (e.g., #admins room if meeting your setup specialist, or Workspaces if setting up categories)

Expected Result:

Onboarding task deeplinks used within the app should redirect users to the correct screen within the app

Actual Result:

Onboarding task deeplinks used within the app redirect users to the web

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6556810_1722294279029.QA-build-web-redirection-9.0.14.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fe8e043da71e3915
  • Upwork Job ID: 1818998994406051154
  • Last Price Increase: 2024-08-22
  • Automatic offers:
    • nkdengineer | Contributor | 103652377
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

Triggered auto assignment to @arosiclair (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@nyomanjyotisa
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Onboarding task deeplinks used within the app redirect users to the web

What is the root cause of that problem?

The links on onboarding tasks created here

App/src/libs/actions/Report.ts

Lines 3272 to 3273 in e81223b

adminsRoomLink: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${ROUTES.REPORT_WITH_ID.getRoute(adminsChatReportID ?? '-1')}`,
workspaceLink: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${ROUTES.WORKSPACE_INITIAL.getRoute(onboardingPolicyID ?? '-1')}`,

So if onboarding completed in production the links become https://new.expensify.com/...
if onboarding completed in staging the links become https://staging.new.expensify.com/...

If onboarding completed in production and link opened in staging we will encounter this issue

What changes do you think we should make in order to solve the problem?

Remove hasSameOrigin has origin from this condition

if (internalNewExpensifyPath && hasSameOrigin) {

if (internalNewExpensifyPath) {

What alternative solutions did you explore? (Optional)

@arosiclair
Copy link
Contributor

arosiclair commented Jul 30, 2024

I reproduced on staging and not on production. It seems like there might be something wrong with our staging ENV for iOS since the link is generated in NewDot and it is using the prod URL. I'll try reproducing on Android to verify.

@arosiclair
Copy link
Contributor

Not reproducible on Android staging v9.0.14.-3. I'm almost certain there's something going on with our staging .env

@arosiclair
Copy link
Contributor

In these logs you can see we're sending Meet your setup specialist... text as a param with the prod link.

@arosiclair arosiclair removed the DeployBlocker Indicates it should block deploying the API label Jul 30, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Jul 30, 2024
@arosiclair arosiclair added Hourly KSv2 and removed Reviewing Has a PR in review Weekly KSv2 labels Jul 30, 2024
@arosiclair
Copy link
Contributor

Okay this .env issue also affects Android so I no longer think that's the root problem.

From what I can see debugging on web, we render the link with the AnchorRenderer and we attempt to parse the link as an internal path here. The link should get parsed regardless of whether it's a prod/staging/dev link. However, Link.getInternalNewExpensifyPath is returning an empty string for the link https://new.expensify.com/r/7732527507011683 which is incorrect.

Fixing Link.getInternalNewExpensifyPath should fix the issue. This code hasn't been modified in many months, so this seems like an old problem that we're only noticing now. I'd say we should fix this but not continue blocking the deploy on it.

@arosiclair
Copy link
Contributor

Easier repro steps:

  1. Log into staging Android/iOS
  2. Copy URL for any report
  3. Paste the URL into the self DM (it should be a staging link)
  4. Paste the URL again but remove staging.
  5. Verify the staging link opens in-app
  6. Verify the production link opens in-app
    • This works on Android but not on iOS. I'm guessing Android is just doing a better job redirecting the link at an OS level here

@roryabraham roryabraham added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@arosiclair
Copy link
Contributor

Alright the verdict is to continue opening new expensify links in their respective environment (eg: staging link should open in staging even if you're in prod).

After creating an optimistic task report, we will update the task description by replacing the CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL with %baseURL/. We need to replace it after we create the optimistic task report because it's used to parse the markdown to link here

This feels hacky. We shouldn't create the report with the wrong link and then fix it later. Can we just create the task with the correct dev/staging/prod link to begin with? It's fine if it doesn't work in a different environment.

@nkdengineer
Copy link
Contributor

Can we just create the task with the correct dev/staging/prod link to begin with? It's fine if it doesn't work in a different environment.

@arosiclair Yes, we can do this. Updated alternative solution with this expected

@arosiclair
Copy link
Contributor

Thank you let's go with your alternative solution.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 23, 2024
Copy link

melvin-bot bot commented Aug 23, 2024

📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@abdulrahuman5196
Copy link
Contributor

Expected Result:

Onboarding task deeplinks used within the app should redirect users to the correct screen within the app
Actual Result:

Onboarding task deeplinks used within the app redirect users to the web

@arosiclair
Just to confirm on decision. The current issue OP is not correct. We don't consider current issue OP as issue but that is the expected behaviour.

So during task creation itself we will use current environment and generate the link. If that link is opened in a different environment mobile app/platform, it would be redirect to web(if particular environment app is not present).
So current expectation is to update the task creation link to have the current environment URL.

@arosiclair
Copy link
Contributor

So current expectation is to update the task creation link to have the current environment URL.

That's correct. If we create an account on staging, the onboarding task should generate a link with a staging URL. On production, it should be a production URL.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 23, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

This issue has not been updated in over 15 days. @JmillsExpensify, @arosiclair, @abdulrahuman5196, @nkdengineer eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@arosiclair
Copy link
Contributor

This hit prod 3 weeks ago so we should be good for payment and closing.

@arosiclair arosiclair added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Monthly KSv2 labels Sep 24, 2024
@JmillsExpensify
Copy link

Payment summary:

@JmillsExpensify
Copy link

@abdulrahuman5196 can you complete the BZ checklist please?

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

Doesn't seem to be a regression.

Determine if we should create a regression test for this bug.

Yes.

If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

  1. Create a new account (please use a public domain)
  2. In the onboarding modal, select "manage my team's expenses"
  3. Go to Expensify chat to view the task checklist
  4. Open a task that contains a deeplink (e.g., meet your setup specialist or set up categories)
  5. Open the desired task and tap on the hyperlink present within the steps (e.g., #admins room if meeting your setup specialist, or Workspaces if setting up categories)
  6. Onboarding task deeplinks used within the app should redirect users to the correct screen within the app

@JmillsExpensify Added the BZ checklist. Sorry for missing it previously.

@melvin-bot melvin-bot bot added the Overdue label Sep 30, 2024
@trjExpensify
Copy link
Contributor

Confirming payment summary as follows:

@JmillsExpensify
Copy link

$250 approved for @abdulrahuman5196

@melvin-bot melvin-bot bot removed the Overdue label Sep 30, 2024
@JmillsExpensify
Copy link

All contributors paid and regression test created. Closing.

@github-project-automation github-project-automation bot moved this from Release 2.5: SuiteWorld (Sept 9th) to Done in [#whatsnext] #wave-collect Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: Done
Development

No branches or pull requests

8 participants