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] Chat - Error message reappears after sending another message #44824

Closed
3 of 6 tasks
izarutskaya opened this issue Jul 4, 2024 · 32 comments
Closed
3 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@izarutskaya
Copy link

izarutskaya commented Jul 4, 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: v9.0.4-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4693768
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to any chat.
  2. Send a corrupted PDF file (there is one attached to this report).
  3. Verify an error message appears.
  4. Dismiss the error message by clicking on the "x" icon.
  5. Send another message.
  6. Verify the error message that was already dismissed reappears.

Expected Result:

The error message should not reappear.

Actual Result:

The error message reappears after sending another message.

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

Bug6532542_1720046830416.bandicam_2024-07-03_18-41-01-357.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0167c1b57ade6a9fb4
  • Upwork Job ID: 1810456336736930787
  • Last Price Increase: 2024-07-15
  • Automatic offers:
    • alitoshmatov | Reviewer | 103158918
    • nyomanjyotisa | Contributor | 103158919
Issue OwnerCurrent Issue Owner: @VictoriaExpensify
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 4, 2024
Copy link

melvin-bot bot commented Jul 4, 2024

Triggered auto assignment to @VictoriaExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb

@VictoriaExpensify
Copy link
Contributor

I haven't had a chance to look at this, will come back to it on Monday

@nyomanjyotisa
Copy link
Contributor

nyomanjyotisa commented Jul 7, 2024

Proposal

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

Error message reappears after sending another message

What is the root cause of that problem?

There is an error when uploading attachment:
image

This happens because we directly assigning the file object (which contains non-clonable properties) to attachmentInfo which we use on optimisticData

This cause an error because we cannot store non-cloneable properties on IndexedDB

This make the reportActions_ onyx data not stored on IndexedDB

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

const attachmentInfo = file ?? {};

Change this code to const attachmentInfo = file ? {...file} : {}; by this changes we create a shallow copy of the file object. This shallow copy contains only the properties of the file object, excluding any non-clonable properties

RESULT

New-Expensify.13.mp4

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jul 7, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

@VictoriaExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@VictoriaExpensify VictoriaExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0167c1b57ade6a9fb4

@melvin-bot melvin-bot bot changed the title Chat - Error message reappears after sending another message [$250] Chat - Error message reappears after sending another message Jul 8, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jul 8, 2024
@VictoriaExpensify
Copy link
Contributor

I agree this is an issue and it should be fixed. Also agree that this is best suited to VSB

@alitoshmatov
Copy link
Contributor

Thank you for your proposal @nyomanjyotisa . Can you expand on your RCA, why exactly having action data in failure data is causing this, I mean failure data is applied when request fails which is happening instantly when error is shown, then we are removing report action with error in https://github.com/expensify/app/blob/1f7c785753747a84b84c859cbdf4503447fc7bac/src/libs/actions/ReportActions.ts#L80

Moreover this piece of code was there for a long time and why now it is causing this?

@amunim
Copy link

amunim commented Jul 13, 2024

Proposal

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

Error messages re-appear

What is the root cause of that problem?

queuedOnyxUpdates is not cleared if an error is thrown, this makes it stay in cache and apply again once we try to send a new message.

function flushQueue(): Promise<void> {
return Onyx.update(queuedOnyxUpdates).then(() => {
queuedOnyxUpdates = [];
});
}

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

We add a catch clause like

    .catch(err => {
        console.error(err);
        queuedOnyxUpdates = [];
    });

or
image

we check if the error is failed to execute 'put' on 'IDBObjectStore', then suppress the error, and splice only that, else throw again (a moderator with experience in the project can answer)

Result after changes:
@alitoshmatov @VictoriaExpensify
https://github.com/user-attachments/assets/975d864e-778a-42c9-be0d-80f03e7c7140

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jul 13, 2024
Copy link

melvin-bot bot commented Jul 13, 2024

📣 @amunim! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@amunim
Copy link

amunim commented Jul 13, 2024

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~016f42c0501a199670

Copy link

melvin-bot bot commented Jul 13, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@nyomanjyotisa
Copy link
Contributor

Copy link

melvin-bot bot commented Jul 15, 2024

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

Copy link

melvin-bot bot commented Jul 15, 2024

@VictoriaExpensify, @alitoshmatov Eep! 4 days overdue now. Issues have feelings too...

@VictoriaExpensify
Copy link
Contributor

@alitoshmatov - what are your thoughts on @nyomanjyotisa updated proposal?

@alitoshmatov
Copy link
Contributor

That makes sense @nyomanjyotisa

We can go with @nyomanjyotisa 's proposal

C+ reviewed 🎀 👀 🎀

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

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

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

melvin-bot bot commented Jul 17, 2024

📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jul 17, 2024

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 17, 2024
@nyomanjyotisa
Copy link
Contributor

PR created @alitoshmatov

@nyomanjyotisa
Copy link
Contributor

bump for PR review @alitoshmatov

@cead22
Copy link
Contributor

cead22 commented Aug 6, 2024

The PR was closed because the issue got fixed elsewhere. That said, contributors should still receive payement. @VictoriaExpensify can you handle that please?

@mallenexpensify
Copy link
Contributor

@VictoriaExpensify both @nyomanjyotisa and @alitoshmatov are due compensation here. Per the internal SO

If a contributor has been hired for a job and we decide to close the job before it is successfully completed, full payment is due for C+ and the contributor. One caveat here might be if the hired contributor wasn't working on their PR with urgency. If you're unsure, post in #bug-zero.

Copy link

melvin-bot bot commented Aug 12, 2024

This issue has not been updated in over 15 days. @cead22, @VictoriaExpensify, @alitoshmatov, @nyomanjyotisa eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Aug 12, 2024
@ahmedGaber93
Copy link
Contributor

We have the same issue after uploading workspace avatar here #47150. Is it should fix here? Asking because we have an accepted proposal here, but nothing there.
@cead22 @alitoshmatov @nyomanjyotisa

@alitoshmatov
Copy link
Contributor

It does look like both are similar, not sure if our solution would have solved this though. @nyomanjyotisa Can you look into #47150 issue

@ahmedGaber93
Copy link
Contributor

@nyomanjyotisa bump #44824 (comment)

@alitoshmatov
Copy link
Contributor

#47150 (comment) They decided to handle the issue there.

Next step for this issue is to handle payment and close the issue

cc: @VictoriaExpensify

@mallenexpensify
Copy link
Contributor

@VictoriaExpensify plz pay both @alitoshmatov and @nyomanjyotisa since @nyomanjyotisa was hired and raised a PR, only for the bug to fixed magically (right?) Carlos commented here too

@VictoriaExpensify
Copy link
Contributor

Payment Summary:
Contributor: @nyomanjyotisa paid $250 via Upwork
Contributor+: @alitoshmatov paid $250 via Upwork

Upwork Job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
No open projects
Status: No status
Development

No branches or pull requests

8 participants