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-06-13] [$1000] Workspace - The empty loading chats are shown in the half part of the screen and the other half is blank #19490

Closed
1 of 6 tasks
kbecciv opened this issue May 23, 2023 · 25 comments
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

@kbecciv
Copy link

kbecciv commented May 23, 2023

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


Action Performed:

  1. Go to staging dot on chrome
  2. Go offline
  3. Create a workspace
  4. Go to announce and send any message
  5. Reply in the same thread
  6. Notice that the 3 loading chats are shown and all the remaining are black blank that makes it look weird
  7. Now go online
  8. Notice that the loading chats are shifted above and the remaining down portion are plain black and doesn't go away until you refresh the page

Expected Result:

The loading chats should not be shown in the half part of the screen that makes it look weird.

Actual Result:

The loading chats are shown in the half part of the screen and the other half is blank

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.3.17.0

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

error-2023-05-18_20.11.50.mp4
Recording.2798.mp4

Expensify/Expensify Issue URL:

Issue reported by: @priya-zha

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684420395406219

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0144bfc6df266a73d1
  • Upwork Job ID: 1661207831671959552
  • Last Price Increase: 2023-05-24
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 23, 2023

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

@jliexpensify
Copy link
Contributor

I can reproduce this on Staging:

image

I would also add to this behaviour and say that when you go back online, the Workspace's #annoucne room doesn't reflect what it should be.

This is what I see when I immediately go back online:

image

This is what I see when I refresh/what it should look like:

image

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label May 24, 2023
@melvin-bot melvin-bot bot changed the title Workspace - The empty loading chats are shown in the half part of the screen and the other half is blank [$1000] Workspace - The empty loading chats are shown in the half part of the screen and the other half is blank May 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0144bfc6df266a73d1

@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

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

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

melvin-bot bot commented May 24, 2023

Triggered auto assignment to @marcochavezf (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@tienifr
Copy link
Contributor

tienifr commented May 24, 2023

Proposal

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

The report action skeletons are shown when users reply the message

What is the root cause of that problem?

  1. When user create a new thread => the reportAction is empty because we don't have logic to add optimisticCreatedAction to the new reportAction

// If we are creating a thread, ensure the report action has childReportID property added
if (newReportObject.parentReportID && parentReportActionID) {
onyxData.optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${newReportObject.parentReportID}`,
value: {[parentReportActionID]: {childReportID: reportID}},
});
onyxData.failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${newReportObject.parentReportID}`,
value: {[parentReportActionID]: {childReportID: '0'}},
});
}
}

=> isLoadingInitialReportActions = true => Full skeleton is shown

const isLoadingInitialReportActions = _.isEmpty(this.props.reportActions) && this.props.report.isLoadingReportActions;

  1. users reply in this thread => the reportActions is not empty

// If we are creating a thread, ensure the report action has childReportID property added
if (newReportObject.parentReportID && parentReportActionID) {
onyxData.optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${newReportObject.parentReportID}`,
value: {[parentReportActionID]: {childReportID: reportID}},
});
onyxData.failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${newReportObject.parentReportID}`,
value: {[parentReportActionID]: {childReportID: '0'}},
});
}
}

=> We show ReportActionsView

  1. At this time, we also reach the end of the list
  2. API ReadOldestAction is called and update isLoadingMoreReportActions = true

value: {
isLoadingMoreReportActions: true,
},

  1. Because we're in offline mode and it's read request =>API is failed => there's no way to update isLoadingMoreReportActions = false => isLoadingMoreReportActions is true at the end
    if (props.report.isLoadingMoreReportActions) {
    return <ReportActionsSkeletonView containerHeight={CONST.CHAT_SKELETON_VIEW.AVERAGE_ROW_HEIGHT * 3} />;
    }

=> The 3 skeletons are shown (line 161)
6. Users go online
7. API 'OpenReport' is called (it's result contains the parentMessage)
8. The parentMessage is shown
9. The minHeight of parent message is 500 => We can see the blank part

return {
minHeight: CONST.EMPTY_STATE_BACKGROUND.WIDE_SCREEN.CONTAINER_MINHEIGHT,
display: 'flex',
justifyContent: 'space-between',
};

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

Add optimisticCreatedAction to onyx If we are creating a thread by moving these line outside if block

 const optimisticCreatedAction = ReportUtils.buildOptimisticCreatedReportAction(newReportObject.ownerEmail);
 onyxData.optimisticData.push({
                onyxMethod: Onyx.METHOD.SET,
                key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
                value: {[optimisticCreatedAction.reportActionID]: optimisticCreatedAction},
            });

What alternative solutions did you explore? (Optional)

We should have the logic to update failureData of read request in makeXHR function

.catch((e)=>{
            const apiRequestType = lodashGet(request, 'data.apiRequestType');
            if (apiRequestType === CONST.API_REQUEST_TYPE.READ) {
                Onyx.update(request.failureData);
            }
           throw e
})

Result

Screen.Recording.2023-05-24.at.15.37.59.mov

@s77rt
Copy link
Contributor

s77rt commented May 24, 2023

@tienifr Thanks for the proposal. Your RCA makes sense. As I understood the sensitive part is the missing CREATED action. We show the skeleton view up until we encounter a CREATED report action and in our case this action is missing. Would that be about right?

I have asked here #18522 (comment).

@s77rt
Copy link
Contributor

s77rt commented May 24, 2023

Confirmed ^

@marcochavezf Let's go with @tienifr's proposal.

🎀 👀 🎀 C+ reviewed

@marcochavezf
Copy link
Contributor

Perfect, thanks @s77rt, assigning @tienifr 🚀

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

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

@jliexpensify
Copy link
Contributor

Invites sent via Upworks.

@tienifr I assume you're Tien Anh. N? If so, can you please add your full name to your GH account so we can easily see who you are for next time? Cheers.

@tienifr
Copy link
Contributor

tienifr commented May 26, 2023

@jliexpensify Done. Thanks for the suggestion!

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

@marcochavezf, @s77rt, @jliexpensify, @tienifr Whoops! This issue is 2 days overdue. Let's get this updated quick!

@s77rt
Copy link
Contributor

s77rt commented Jun 2, 2023

Not overdue. We have a PR already and it's waiting for @marcochavezf's review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 6, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Workspace - The empty loading chats are shown in the half part of the screen and the other half is blank [HOLD for payment 2023-06-13] [$1000] Workspace - The empty loading chats are shown in the half part of the screen and the other half is blank Jun 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.24-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 2023-06-13. 🎊

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 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:

  • [@s77rt] The PR that introduced the bug has been identified. Link to the PR:
  • [@s77rt] 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:
  • [@s77rt] 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:
  • [@s77rt] Determine if we should create a regression test for this bug.
  • [@s77rt] 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.
  • [@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@s77rt
Copy link
Contributor

s77rt commented Jun 6, 2023

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 13, 2023
@jliexpensify
Copy link
Contributor

@marcochavezf couple of questions for you:

  • Is no regression test ok?
  • It looks like the iOS and Android deploys for this PR were cancelled, this shouldn't be an issue for payments right?

If not, I'll pay $1000 to both @tienifr and @s77rt .

@jliexpensify
Copy link
Contributor

Bump @marcochavezf to the above questions!

@marcochavezf
Copy link
Contributor

Hi @jliexpensify, yeap, it's fine

@jliexpensify
Copy link
Contributor

Everyone has been hired! Thanks Marco.

@jliexpensify
Copy link
Contributor

Everyone's paid, job closed. Cheers!

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

5 participants