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-02-20] [$500] Chat – Message draft created Offline disappears while go back Online and refresh page #34667

Closed
1 of 6 tasks
lanitochka17 opened this issue Jan 17, 2024 · 45 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

@lanitochka17
Copy link

lanitochka17 commented Jan 17, 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.26-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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in
  3. Go Offline
  4. Open any chat and draft a message in it
  5. Go back Online (not focus on the chat) refresh the page

Expected Result:

The conversation is still displayed to the top of LHN (maintaining the same drafted status)
The drafted message is still displayed in the compose box

Actual Result:

The conversation is not displayed to the top of LHN (not maintaining the same drafted status)
The drafted message is not displayed in the compose box

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

Bug6345665_1705518174665.Message_draft_created_Offline_disappears.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01169b0346fc6a15b0
  • Upwork Job ID: 1747720921283096576
  • Last Price Increase: 2024-01-24
  • Automatic offers:
    • situchan | Contributor | 28129739
    • ZhenjaHorbach | Contributor | 28142252
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 17, 2024
@melvin-bot melvin-bot bot changed the title Chat – Message draft created Offline disappears while go back Online and refresh page [$500] Chat – Message draft created Offline disappears while go back Online and refresh page Jan 17, 2024
Copy link

melvin-bot bot commented Jan 17, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01169b0346fc6a15b0

Copy link

melvin-bot bot commented Jan 17, 2024

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

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

melvin-bot bot commented Jan 17, 2024

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Jan 17, 2024

Proposal

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

Chat – Message draft created Offline disappears while go back Online and refresh page

What is the root cause of that problem?

Small clarification
This bug can always be reproduced when reloading the page when we have a modal open

The main problem with this issue is that when we reload the page when ReportScreen is out of focus, by default we have reportID === 0
As a result, we can't get any draftMessage value for Composer

This is because we take reportID from the route

report: {
key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${getReportID(route)}`,
allowStaleData: true,
selector: reportWithoutHasDraftSelector,
},

But since we are on a different screen, we initially don’t have reportID
And since we don’t have any draftMessage handler for these cases, we don’t change this value in any way

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

To fix this issue we can add useEffect for the composer
Which will check the state of the draft value and will replace it when our reportID changes (Optional we can update this useEffect which will trigger only once when we have a valid reportID )

    useEffect(() => {
       const draft = getDraftComment(reportID) || '';
       updateComment(draft);
    }, [reportID]);

What alternative solutions did you explore? (Optional)

As an alternative, we can add a condition for SilentCommentUpdater and when reportID will be available to call useEffect inside the component and update the message

            {reportID !== '0' && (
                <SilentCommentUpdater
                    reportID={reportID}
                    report={report}
                    value={value}
                    updateComment={updateComment}
                    commentRef={commentRef}
                />
            )}

<SilentCommentUpdater
reportID={reportID}
report={report}
value={value}
updateComment={updateComment}
commentRef={commentRef}
/>

@melvin-bot melvin-bot bot added the Overdue label Jan 22, 2024
@anmurali
Copy link

@alitoshmatov - can you review and comment on the proposal above?

@melvin-bot melvin-bot bot removed the Overdue label Jan 22, 2024
@alitoshmatov
Copy link
Contributor

I was not able to reproduce this issue, is there any additional steps involved.

Screen.Recording.2024-01-24.at.16.15.41.mov

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Jan 24, 2024

Last main )

Screen.Recording.2024-01-24.at.12.49.12.mov

Plus easy way )

Screen.Recording.2024-01-24.at.12.51.14.mov

@alitoshmatov
Copy link
Contributor

Not sure what I am doing wrong, but still not reproducible on me
https://github.com/Expensify/App/assets/59907218/c652f4a9-4ebe-4396-b0b3-57ecb20558f6

@ZhenjaHorbach
Copy link
Contributor

Yes, very strange
This bug keeps reproducing for me
And I double-checked and I have the latest version of main

@alitoshmatov
Copy link
Contributor

I reproduced it on desktop application but, I don't think refreshing is expected behavior on desktop
https://github.com/Expensify/App/assets/59907218/34feff59-4647-485d-b62f-2f8f97575cd8

@ZhenjaHorbach
Copy link
Contributor

What about staging or prod ?)
I also have a bug there)
And I test everything on Mac with Chrome browser

@alitoshmatov
Copy link
Contributor

Yes I was able to reproduce it on staging, still curious why it wasn't reproducible on local testing. Let me do some research on this issue then.

Copy link

melvin-bot bot commented Jan 24, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@alitoshmatov
Copy link
Contributor

@ZhenjaHorbach just to be 100% sure can you retest this issue on the latest main. If you manage to reproduce it. I will ask for other c+ help and reassign if they can also reproduce

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Jan 25, 2024

Still reproduce )
Last main
Last node_modules

Screen.Recording.2024-01-25.at.09.26.13.mov

@situchan
Copy link
Contributor

I reproduced with very simple step: (need to refresh quickly)

  1. Open any chat and draft message
  2. Quickly refresh app
Screen.Recording.2024-01-25.at.4.01.18.PM.mov

And another step: (no need quick action to refresh)

  1. Open any chat and draft message
  2. Open Settings page
  3. Refresh
Screen.Recording.2024-01-25.at.4.05.44.PM.mov

(both steps don't require offline/online switch)

@alitoshmatov
Copy link
Contributor

@situchan Will you be able to take it over?

@situchan
Copy link
Contributor

@situchan Will you be able to take it over?

sure if you want to

@alitoshmatov
Copy link
Contributor

That would be great.

@anmurali can you reassign this issue to @situchan

@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Feb 13, 2024
@melvin-bot melvin-bot bot changed the title [$500] Chat – Message draft created Offline disappears while go back Online and refresh page [HOLD for payment 2024-02-20] [$500] Chat – Message draft created Offline disappears while go back Online and refresh page Feb 13, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 13, 2024
Copy link

melvin-bot bot commented Feb 13, 2024

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

Copy link

melvin-bot bot commented Feb 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.40-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-02-20. 🎊

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

Copy link

melvin-bot bot commented Feb 13, 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:

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

@anmurali anmurali removed the Bug Something is broken. Auto assigns a BugZero manager. label Feb 16, 2024
@anmurali anmurali removed their assignment Feb 16, 2024
@anmurali anmurali added the Bug Something is broken. Auto assigns a BugZero manager. label Feb 16, 2024
Copy link

melvin-bot bot commented Feb 16, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 16, 2024
@anmurali
Copy link

Payment not due for another 4 days but I will be OOO so I have reassigned for payment

@joekaufmanexpensify
Copy link
Contributor

Sounds good! @situchan please complete the checklist so we can prep to issue payment next week.

@joekaufmanexpensify joekaufmanexpensify added Weekly KSv2 and removed Daily KSv2 labels Feb 16, 2024
@situchan
Copy link
Contributor

Not able to find exact offending PR as Report screen was refactored several times (mainly for performance improvement).
I think this bug existed for a while.
We can skip regression test as caught by QA team, assuming this case already exists in TestRail.

@joekaufmanexpensify joekaufmanexpensify added Daily KSv2 and removed Weekly KSv2 labels Feb 19, 2024
@joekaufmanexpensify
Copy link
Contributor

BZ checklist is all set. All set to issue payment tomorrow.

@joekaufmanexpensify
Copy link
Contributor

We need to make the following payments:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Feb 20, 2024
@joekaufmanexpensify
Copy link
Contributor

All set to issue payment.

@joekaufmanexpensify
Copy link
Contributor

@ZhenjaHorbach $500 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@situchan $500 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Upwork job closed.

@joekaufmanexpensify
Copy link
Contributor

All set. Thanks everyone!

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

8 participants