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] [HOLD for payment 2024-04-05] Workspace - Not here page shows up when opening message in thread in deleted workspace #38183

Closed
6 tasks done
lanitochka17 opened this issue Mar 12, 2024 · 43 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering Monthly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Mar 12, 2024

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


Version Number: 1.4.51-0
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

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Send a message
  4. Delete the workspace
  5. Return to the workspace chat
  6. Hover over the message in Step 3 > Reply in thread

Expected Result:

The message will be opened in archived thread

Actual Result:

Not here page shows up when opening message in thread in deleted workspace

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

Bug6411510_1710274628913.20240313_041445.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0129fa34eb79923fe5
  • Upwork Job ID: 1777369739173396480
  • Last Price Increase: 2024-04-08
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Mar 12, 2024
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.

Copy link

melvin-bot bot commented Mar 12, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp
CC @quinthar

@lanitochka17
Copy link
Author

@blimpich FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

Production:

Recording.1396.mp4

@allgandalf
Copy link
Contributor

Proposal

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

What is the root cause of that problem?

Offending PR #35566

The double assertion !! actually leads to true and we get shouldShowNotFoundPage to true:

(!!reportIDFromParams && !ReportUtils.isValidReportIDFromPath(reportIDFromParams)),

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

const reportIDFromParams = route.params.reportID;

Set reportIDFromParams to '' if we don't have reportID

Then remove !!reportIDFromParams && this will give correct value to shouldShowNotFoundPage

What alternative solutions did you explore? (Optional)

N/A

@blimpich
Copy link
Contributor

@GandalfGwaihir thank you for identifying the PR that caused this regression! However we generally regard deploy blockers to be the responsibility of who created them. So I would expect @VickyStash and @aimane-chnaif to handle this, as part of them completing #25216.

Demoting this since its not a particularly bad bug, and is a more niche scenario.

@blimpich blimpich added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Mar 12, 2024
@blimpich
Copy link
Contributor

Hmmm, for some reason GitHub won't let me assign @VickyStash to this issue. Either way, @VickyStash @aimane-chnaif can you handle this issue as a follow up to the typescript conversion?

@allgandalf
Copy link
Contributor

No worries, @VickyStash can use my proposal to triage the issue faster :) thanks

@VickyStash
Copy link
Contributor

@blimpich Sure, on my way to prepare follow-up PR!

@VickyStash
Copy link
Contributor

Btw, the suggested proposal didn't work for me, I still see the same message.
And for me, it looks like the problem is in the first part of the shouldShowNotFoundPage variable condition, cause that's what turning to true for me.
I'm continuing to investigate...

@nkdengineer
Copy link
Contributor

nkdengineer commented Mar 13, 2024

Proposal

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

  • WS switcher resets to Expensify when creating a room under the same WS

What is the root cause of that problem?

  • When replying in chat, in here we call navigateToAndOpenChildReport
  • In that function, there is logic that navigate user to thread:
    Navigation.navigateWithSwitchPolicyID({route: ROUTES.HOME});
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID));
  • There is the case that the report data is not stored successfully before navigating to it, so that leads to more than one OpenReport API is called. The 2nd call will set the report as null, that leads to the bug.

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

  • We need to make sure the report in here is always stored successfully before calling Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(newChat.reportID)).
  • We can do it by creating a isReadyPromise in ReportUtils like the one below:
let waitingReportID: string = ''
let resolveIsReadyPromise: (args?: unknown[]) => void;
let isReadyPromise =(reportID: string)=> new Promise((resolve) => {
    waitingReportID = reportID
    resolveIsReadyPromise = resolve;
});

function checkRequiredData() {
    const targetReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${waitingReportID}`] ?? {};
    if(targetReport?.reportID){
        resolveIsReadyPromise();
    }
   
}
Onyx.connect({
    key: ONYXKEYS.COLLECTION.REPORT,
    waitForCollectionCallback: true,
    callback: (value) => {
        allReports = value
        checkRequiredData()
    },
});
        ReportUtils.isReadyPromise(newChat.reportID).then(()=>{
            Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(newChat.reportID));
        })

What alternative solutions did you explore? (Optional)

@allgandalf
Copy link
Contributor

@VickyStash , i removed !!reportIDFromParams and it worked as expected for me, the value of !!reportIDFromParams is always set as true :)

@VickyStash
Copy link
Contributor

@GandalfGwaihir I've tried twice with your solution, and I still see the same problem 😅 But overall this part of the code was added in this PR, and it initially had this check for reportIDFromParams, so I haven't changed the logic.

@aimane-chnaif
Copy link
Contributor

@GandalfGwaihir I don't think that line is the root cause.
reportIDFromParams && !ReportUtils.isValidReportIDFromPath(reportIDFromParams) was original code.
When it's empty string, returns '' so it shouldn't affect shouldShowNotFoundPage logic even after changing it to boolean

@allgandalf
Copy link
Contributor

What i mean to say is if we only have !ReportUtils.isValidReportIDFromPath(reportIDFromParams as a condition check, then this works fine and we are able to see threads in deleted messages :) so ig the problem would lie in the way we do !!reportIDFromParams

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Mar 13, 2024

@GandalfGwaihir I don't get what you mean. Please explain with example.
Old code: reportIDFromParams && !ReportUtils.isValidReportIDFromPath(reportIDFromParams)
New code: !!reportIDFromParams && !ReportUtils.isValidReportIDFromPath(reportIDFromParams)
Your solution: !ReportUtils.isValidReportIDFromPath(reportIDFromParams)

If this is the offending line, why reverting to old code doesn't work?

@VickyStash
Copy link
Contributor

@GandalfGwaihir Do you exactly follow the flow described in the ticket? You mention deleted messages, but in the test steps, it says to remove the workspace

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Mar 13, 2024

@GandalfGwaihir Based on your comment, this bug should have been existed for a while, not a deploy blocker.

@allgandalf
Copy link
Contributor

@aimane-chnaif , this is not reproducible in production though :)

simplescreenrecorder-2024-03-13_19.13.47.mp4

@melvin-bot melvin-bot bot added the Overdue label Apr 8, 2024
@miljakljajic miljakljajic added the External Added to denote the issue can be worked on by a contributor label Apr 8, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-04-05] Workspace - Not here page shows up when opening message in thread in deleted workspace [$250] [HOLD for payment 2024-04-05] Workspace - Not here page shows up when opening message in thread in deleted workspace Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 8, 2024
@miljakljajic miljakljajic removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

@miljakljajic
Copy link
Contributor

@aimane-chnaif I am having issues hiring you for the job - can you please apply to it in upwork? I sent you an invite to the posting but I couldn't hire you:
image

@miljakljajic
Copy link
Contributor

@aimane-chnaif is OOO, he'll accept when he comes back.

@melvin-bot melvin-bot bot added the Overdue label Apr 11, 2024
@blimpich
Copy link
Contributor

not overdue

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 11, 2024
@miljakljajic miljakljajic added Weekly KSv2 and removed Daily KSv2 labels Apr 15, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 15, 2024
@melvin-bot melvin-bot bot added the Overdue label Apr 23, 2024
@miljakljajic miljakljajic added Monthly KSv2 and removed Weekly KSv2 labels Apr 24, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2024
@miljakljajic
Copy link
Contributor

miljakljajic commented Apr 24, 2024

still waiting on aimane

@miljakljajic
Copy link
Contributor

Going to close this out and we can re-open when Aimane comes back. I have also DMed them in slack.

@aimane-chnaif
Copy link
Contributor

@miljakljajic sorry I am back. Can you please reopen and sort payment on upwork? Thanks

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 Engineering Monthly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants