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 2024-04-05] [$500] Workspace - #admin room with messages shows skeleton loading after workspace is deleted #38839

Closed
6 tasks done
kbecciv opened this issue Mar 22, 2024 · 31 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Mar 22, 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: 1.4.56-0
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com.
  2. Create a new workspace.
  3. Go to #admin room.
  4. Send a message.
  5. Delete the workspace.
  6. Go to #admin room.

Expected Result:

#admin room will not show skeleton loading after the workspace is deleted.

Actual Result:

#admin room shows skeleton loading after the workspace is deleted.

Workaround:

n/a

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

Bug6423448_1711129084965.20240323_013502.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0190baa2ce2890e3e7
  • Upwork Job ID: 1772371688906227712
  • Last Price Increase: 2024-03-25
  • Automatic offers:
    • ishpaul777 | Contributor | 0
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Mar 22, 2024
@kbecciv
Copy link
Author

kbecciv commented Mar 22, 2024

We think that this bug might be related to #vip-vsb

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 22, 2024

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

@aldo-expensify
Copy link
Contributor

The GetOlderActions command is erroring out, sample logs: 86894ae17a5e2d72-YVR

image

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Mar 22, 2024

Seems like the functions loadOlderChats and loadNewerChats gets called in a infinite loop:

image

The InvertedFlatList is calling them here:

onEndReached={loadOlderChats}
onEndReachedThreshold={0.75}
onStartReached={loadNewerChats}
onStartReachedThreshold={0.75}

@aldo-expensify
Copy link
Contributor

Adding external and bug to see if we can get a contributor to help here

@melvin-bot melvin-bot bot removed the Overdue label Mar 25, 2024
@aldo-expensify aldo-expensify added External Added to denote the issue can be worked on by a contributor Overdue Bug Something is broken. Auto assigns a BugZero manager. labels Mar 25, 2024
@melvin-bot melvin-bot bot changed the title Workspace - #admin room with messages shows skeleton loading after workspace is deleted [$500] Workspace - #admin room with messages shows skeleton loading after workspace is deleted Mar 25, 2024
Copy link

melvin-bot bot commented Mar 25, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0190baa2ce2890e3e7

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

melvin-bot bot commented Mar 25, 2024

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

Copy link

melvin-bot bot commented Mar 25, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Mar 25, 2024
@mallenexpensify
Copy link
Contributor

@aldo-expensify , does this need to be a deploy blocker? I have a feeling it might be related to comment linking, multiple bugs have been reported, like here https://expensify.slack.com/archives/C049HHMV9SM/p1711147499521539

cc @roryabraham , you likely have a better idea if it's related.

@aldo-expensify
Copy link
Contributor

@aldo-expensify , does this need to be a deploy blocker?

I think so, it is causing a regression that doesn't allow opening the admin room.

@abzokhattab
Copy link
Contributor

Proposal

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

The app keeps calling the loading skeleton after a workspace is deleted

What is the root cause of that problem?

the reportActions returned from the getContinuousReportActionChain always have fewer actions after deleting the workspace

this happens because the optimistic value of the delete workspace action doesn't have a previousReportActionID so the conditions here fails after one iteration

image

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

we can modify the endIndex loop so that it skips if the current action is close

    while (
        (endIndex < sortedReportActions.length - 1 && sortedReportActions[endIndex].previousReportActionID === sortedReportActions[endIndex + 1].reportActionID) ||
        !!sortedReportActions[endIndex + 1]?.whisperedToAccountIDs?.length ||
        !!sortedReportActions[endIndex]?.whisperedToAccountIDs?.length ||
        sortedReportActions[endIndex]?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM ||
        sortedReportActions[endIndex]?.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED ||
        sortedReportActions[endIndex + 1]?.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED ||
        sortedReportActions[endIndex + 1]?.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED
    ) {

POC:

Screen.Recording.2024-03-26.at.6.40.04.AM.mov

alternatively:

or we can pass a previousReportActionID to the buildOptimisticClosedReportAction and set it to the last action id so that the first condition passes for the optimistic action.

@sobitneupane
Copy link
Contributor

sobitneupane commented Mar 26, 2024

Thanks for the proposal @abzokhattab

There are two Closed action which looks like the reason for the issue. Why do we have two Closed Actions in the first place? One of them don't have previousReportActionID which probably is the one optimistically added.
Screenshot 2024-03-26 at 15 13 45

This PR might have caused the regression.

Does reverting the PR and adding previousReportActionID optimistically solves both this issue and #35174 issue?

@aldo-expensify aldo-expensify added Hourly KSv2 and removed Weekly KSv2 Reviewing Has a PR in review labels Mar 26, 2024
@aldo-expensify
Copy link
Contributor

@roryabraham @perunt when you have some time, can you check if this solution makes sense to you? 🙏

@yuwenmemon yuwenmemon added the Reviewing Has a PR in review label Mar 26, 2024
@roryabraham
Copy link
Contributor

PR is being CP'd presently

@roryabraham roryabraham removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 27, 2024
@aldo-expensify aldo-expensify added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 Reviewing Has a PR in review labels Mar 27, 2024
@mallenexpensify
Copy link
Contributor

This hit production two days ago 🎉
Gonna close this, doesn't look like @sobitneupane reviewed the PR. If I'm wrong, please comment, reopen.

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Mar 28, 2024

Created issue to handle the follow up work for this: https://github.com/Expensify/Expensify/issues/383435

@aldo-expensify
Copy link
Contributor

@mallenexpensify : @ishpaul777 ended up reviewing

@aldo-expensify aldo-expensify removed the External Added to denote the issue can be worked on by a contributor label Mar 28, 2024
Copy link

melvin-bot bot commented Mar 28, 2024

📣 @ishpaul777 🎉 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 📖

@ishpaul777
Copy link
Contributor

hmm, this doesn't require a payment i was c+ on the offending PR

@aldo-expensify
Copy link
Contributor

ohh thanks for clearing that up!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Mar 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] Workspace - #admin room with messages shows skeleton loading after workspace is deleted [HOLD for payment 2024-04-05] [$500] Workspace - #admin room with messages shows skeleton loading after workspace is deleted Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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 2024-04-05. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Mar 29, 2024

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:

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

No branches or pull requests

9 participants