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

[HOLD for payment 2023-04-10] [$2000] Deep links from web fail to open in desktop #15965

Closed
2 of 6 tasks
kavimuru opened this issue Mar 14, 2023 · 46 comments
Closed
2 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

@kavimuru
Copy link

kavimuru commented Mar 14, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Log in with any account on Chrome
  2. Go to a chat or room
  3. Copy the URL
  4. Open a new tab, paste the URL and hit enter
  5. Click open in Electron

Expected Result:

The chat opens in NewDot desktop

Actual Result:

Blank Electron app opens

Workaround:

unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.2.84-1
Reproducible in staging?: y
Reproducible in production?: y
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:
image (1)

Recording.130.mp4

Expensify/Expensify Issue URL:
Issue reported by: @neil-marcellini
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1678714242713519

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0129c287b9f9e7ed8f
  • Upwork Job ID: 1635998154598023168
  • Last Price Increase: 2023-03-22
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 14, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Mar 14, 2023
@MelvinBot
Copy link

Triggered auto assignment to @isabelastisser (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@neil-marcellini neil-marcellini self-assigned this Mar 15, 2023
@neil-marcellini
Copy link
Contributor

Assigning myself to CME. I think this can be external.

@isabelastisser isabelastisser added the External Added to denote the issue can be worked on by a contributor label Mar 15, 2023
@melvin-bot melvin-bot bot unlocked this conversation Mar 15, 2023
@melvin-bot melvin-bot bot changed the title Public chat room fails to open in desktop app [$1000] Public chat room fails to open in desktop app Mar 15, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~0129c287b9f9e7ed8f

@MelvinBot
Copy link

Current assignee @isabelastisser is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 15, 2023
@MelvinBot
Copy link

Current assignee @neil-marcellini is eligible for the External assigner, not assigning anyone new.

@tienifr
Copy link
Contributor

tienifr commented Mar 15, 2023

Proposal

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

Blank Electron app opens when user enters a public room.

What is the root cause of that problem?

The root cause is that the user logged in does not have the permission to view the room so it returns a blank page.

The condition is in here

if (!Permissions.canUsePolicyRooms(this.props.betas) && ReportUtils.isUserCreatedPolicyRoom(this.props.report)) {
.

I believe the expected result must be that the user sees the 'Not found' page for the report.

This is happening for all platforms, not just Desktop.

@neil-marcellini can you confirm if the user that has issue can view the New room button when clicking the green plus button? If that user cannot see New room then they also cannot access the public rooms created by other users as well.

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

Instead of just returning null for the page, we need to show the FullPageNotFoundView. This can be done by removing the condition in

if (!Permissions.canUsePolicyRooms(this.props.betas) && ReportUtils.isUserCreatedPolicyRoom(this.props.report)) {
and add that condition again to the FullPageNotFoundView 's shouldShow here
<FullPageNotFoundView

Not only the above but I think all cases that we're currently returning null as the main report page should show the NotFound page instead, since it's not good UX to show a blank page without any content or indicating that the page is not found. So we might want to create a method there like shouldShowNotFoundPage to include all those conditions, and use it in FullPageNotFoundView's shouldShow.

What alternative solutions did you explore? (Optional)

If we want to show a different kind of page/message, like a No permission page instead of Not found, we can customize the FullPageNotFoundView to show it.

@kaushiktd
Copy link
Contributor

It seems the visibility of buttons is not available to check the following steps given.

  • Click the green plus, new room
  • Fill out the details and choose public for the visibility
    Screenshot 2023-03-16 at 10 52 14 AM

@neil-marcellini neil-marcellini changed the title [$1000] Public chat room fails to open in desktop app [$1000] Deep links from web fail to open in desktop Mar 16, 2023
@neil-marcellini
Copy link
Contributor

I updated the description since @jasperhuangg helped me determine that the issue is not specific to public rooms, it occurs with any chat (report).

@kaushiktd you have to create a workspace first.

@eVoloshchak
Copy link
Contributor

@tienifr's proposal looks good to me!

Not only the above but I think all cases that we're currently returning null as the main report page should show the NotFound page instead, since it's not good UX to show a blank page without any content or indicating that the page is not found. So we might want to create a method there like shouldShowNotFoundPage to include all those conditions, and use it in FullPageNotFoundView's shouldShow.

I agree with this. We did the same thing for the workspace detail pages in #14744 recently.
🎀👀🎀 C+ reviewed!

@hayata-suenaga
Copy link
Contributor

hayata-suenaga commented Mar 16, 2023

@neil-marcellini @jasperhuangg I encountered this issue while I was working on another issue related to desktop deep linking.

I think currently both production and staging NewDot website links to dev desktop app. That's why you see the default Electron app when you're not running dev desktop. This is the issue reported originally.

Quick test:

  1. Make sure you have both production and staging desktop NewDot on your computer.
  2. Go to production or staging NewDot website on the same computer.
  3. Reload the website to be prompted to open Electron.
  4. Check Electron has the default screen, saying you should run a command to start an Electron app.
  5. Close the Election app that opened in step 5
  6. Start the dev NewDot desktop with npm run desktop
  7. Do steps 2 and 3
  8. Check the development desktop opens instead.

Screenshot 2023-03-16 at 11 30 15 AM

What @tienifr observed might be a different problem than the above problem.

When you followed the deep link from production or staging to local dev desktop, the chat room doesn't exist as we're just talking to the local database on dev. @tienifr and @jasperhuangg probably saw this one instead.

Screenshot 2023-03-16 at 11 37 59 AM

Let me know if this is what you saw.

@eVoloshchak
Copy link
Contributor

@hayata-suenaga, thanks for the clarification!
You are correct, I was able to reproduce this using your steps
Do you have ideas on how to resolve this?

@tienifr
Copy link
Contributor

tienifr commented Mar 17, 2023

thanks @hayata-suenaga for the explanation, I'll report my observation as a separate bug.

@tienifr
Copy link
Contributor

tienifr commented Mar 17, 2023

Proposal

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

Production or staging NewDot website is opening the dev Desktop App, an a chat from production shows as not found.

What is the root cause of that problem?

The root cause is that we're using the same URL scheme for all environments (new-expensify://), which will cause issues like this when deep linking from 1 environment opens another.

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

For desktop, we should use different scheme for at least dev vs other environments.

We will create an util to retrieve the DEEPLINK_BASE_URL rather than hardcoding in

DEEPLINK_BASE_URL: 'new-expensify://',
.

If it's desktop and the CONFIG.ENVIRONMENT === CONST.ENVIRONMENT.DEV, we'll return new-expensify-dev:// as the scheme. Otherwise it will be new-expensify:// as currently.

Then we need to use the util in various places where we're referring to the scheme like in here, here, here amongst other places.

With this fix, staging/desktop and dev will have different URL schemes and staging/desktop web will not open Dev Desktop.

What alternative solutions did you explore? (Optional)

The above is sufficient to fix this issue. However we might want to extend the solution so that the scheme is different for all environments (prod, staging, dev) and to Android/iOS as well (For Android/iOS we need to use app schemes).

@MelvinBot
Copy link

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.

@hayata-suenaga hayata-suenaga self-assigned this Mar 17, 2023
@hayata-suenaga
Copy link
Contributor

assigned myself to follow the discussions

@MelvinBot
Copy link

📣 @allroundexperts You have been assigned to this job by @neil-marcellini!
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 📖

@MelvinBot
Copy link

@eVoloshchak @neil-marcellini @allroundexperts @isabelastisser this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@allroundexperts
Copy link
Contributor

PR created: #16650

@isabelastisser
Copy link
Contributor

Hired in Upwork:

@allroundexperts - approved proposal
@eVoloshchak - C+ review

https://www.upwork.com/jobs/~0129c287b9f9e7ed8f

Issue reported by: @neil-marcellini

@eVoloshchak
Copy link
Contributor

@neil-marcellini, shouldn't this still be open until the PR hits production, regression period passes and we finish the BugZero Checklist?

@neil-marcellini
Copy link
Contributor

Yes that's a strange bug.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 3, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Deep links from web fail to open in desktop [HOLD for payment 2023-04-10] [$2000] Deep links from web fail to open in desktop Apr 3, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 3, 2023
@MelvinBot
Copy link

Reviewing label has been removed, please complete the "BugZero Checklist".

@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.93-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-04-10. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@MelvinBot
Copy link

MelvinBot commented Apr 3, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@eVoloshchak / @neil-marcellini] The PR that introduced the bug has been identified. Link to the PR:
    N/A missed during initial implementation
  • [@eVoloshchak / @neil-marcellini] 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:
    N/A missed during initial implementation
  • [@eVoloshchak / @neil-marcellini] 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:
    N/A
  • [@isabelastisser] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] 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.
  • [@isabelastisser] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Apr 10, 2023
@isabelastisser
Copy link
Contributor

@neil-marcellini @eVoloshchak , I'm missing the link to this discussion. Was one already created? Please follow up, thanks!

[@eVoloshchak / @neil-marcellini] 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:

@isabelastisser
Copy link
Contributor

The payment was made and the contract ended in Upwork.

@allroundexperts
Copy link
Contributor

Thanks for the payment @isabelastisser. I was curious on why I did not receive 50% bonus. Has something changed? Are we now capping the bonus to $500?

@isabelastisser
Copy link
Contributor

Sorry for the mistake, @allroundexperts; I corrected it now!

@isabelastisser
Copy link
Contributor

Bump @neil-marcellini and @eVoloshchak on my comment above so that I can close this issue asap. Thanks!

#15965 (comment)

@neil-marcellini
Copy link
Contributor

The discussion is not applicable.

@neil-marcellini
Copy link
Contributor

I don't really think we need a regression test for this because it's an edge case and unlikely to effect real users.

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
None yet
Development

No branches or pull requests

9 participants