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] Track expense - App returns to main chat when sending reply to the deleted expense thread #53539

Open
8 tasks done
IuliiaHerets opened this issue Dec 4, 2024 · 26 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors Internal Requires API changes or must be handled by Expensify staff

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 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: 9.0.71-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Click > Track expense > Manual.
  4. Track a manual expense.
  5. Go to transaction thread.
  6. Add a reply.
  7. Click on the report header > Delete expense.
  8. Delete the expense.
  9. Refresh the page to see the deleted thread with reply.
  10. Click on the reply.
  11. Send another reply to the thread.

Expected Result:

App will not return to main chat after sending a reply in the thread of deleted track expense.

Actual Result:

App returns to main chat every time when sending a reply in the thread of deleted track expense.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6684106_1733306414150.20241204_175308.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021866466017302505976
  • Upwork Job ID: 1866466017302505976
  • Last Price Increase: 2024-12-24
Issue OwnerCurrent Issue Owner: @ikevin127
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

Triggered auto assignment to @zanyrenney (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.

@melvin-bot melvin-bot bot added the Overdue label Dec 6, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

@zanyrenney Huh... This is 4 days overdue. Who can take care of this?

@zanyrenney
Copy link
Contributor

WHOOPS!

@melvin-bot melvin-bot bot removed the Overdue label Dec 10, 2024
@zanyrenney
Copy link
Contributor

endless loop, yes we should fix this!

@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Dec 10, 2024
@melvin-bot melvin-bot bot changed the title Track expense - App returns to main chat when sending reply to the deleted expense thread [$250] Track expense - App returns to main chat when sending reply to the deleted expense thread Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 10, 2024
@zanyrenney zanyrenney moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

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

@MrMuzyk
Copy link
Contributor

MrMuzyk commented Dec 12, 2024

I am Michał from Callstack - expert contributor group. I’d like to work on this job.

@linhvovan29546

This comment was marked as resolved.

@ikevin127
Copy link
Contributor

@MrMuzyk from Callstack showed interested in picking this one up based on #53539 (comment).

🎀👀🎀 C reviewed

Copy link

melvin-bot bot commented Dec 12, 2024

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

@MrMuzyk
Copy link
Contributor

MrMuzyk commented Dec 12, 2024

The source of the problem presented by @linhvovan29546 is correct. However the solution - even though it works - it seems to me more like an optional fix than a proper one.

When adding a new comment via the AddComment API, the returned Onyx data is missing the isDeletedParentAction field

Somewhere along the way isDeletedParentAction flag disappears between onyx updates and I'm trying to find the exact spot where it happens. This is the actual root cause and it might be causing more problems that we are not aware of. Tracking and fixing it would be a proper fix.

I haven't found the exact spot and cause for this yet. Doing my best

@MrMuzyk
Copy link
Contributor

MrMuzyk commented Dec 12, 2024

Proposal

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

App returns to main chat every time when sending a reply in the thread of deleted track expense.

What is the root cause of that problem?

isDeletedParentAction is missing from the report's message inside Onyx. I've tried tracking down where exactly is disappears and I believe it happens after AddComment command. Optimistic data doesn't seem to change it and it's gonne after API call finishes. Response returned from API after posting a comment via AddComment command doesn't return isDeletedParentAction field inside message. This is gives a false positive in one of the condition leading to unnecessary redirect

Report inside Onyx before AddComment
Screenshot 2024-12-12 at 15 35 12

Response from AddComment
Screenshot 2024-12-12 at 15 42 34

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

Investigate AddComment command on the BE side. I believe that API should return isDeletedParentAction field inside a message in a response to adding a comment but for some reason it doesn't do it now.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

ReportActionsUtils.isDeletedParentAction is returning incorrect value because it expects isDeletedParentAction flag. If that flag is missing we can check if field called deleted is present. I believe usually both of the fields should be present at the same time so checking for either of them might be a good temporary solution

@ikevin127
Copy link
Contributor

Investigate AddComment command on the BE side. I believe that API should return isDeletedParentAction field inside a message in a response to adding a comment but for some reason it doesn't do it now.

I think @neil-marcellini should be able to help with this part to figure out whether this requires a BE fix or we should do something FE wise.

Copy link

melvin-bot bot commented Dec 16, 2024

@neil-marcellini, @ikevin127, @zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 16, 2024
@ikevin127
Copy link
Contributor

Awaiting Neil's feedback on #53539 (comment) whether we should fix this on BE side or go the route of a temporary FE fix as suggested by alternative from #53539 (comment).

@melvin-bot melvin-bot bot removed the Overdue label Dec 16, 2024
Copy link

melvin-bot bot commented Dec 17, 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 Dec 18, 2024

@neil-marcellini @ikevin127 @zanyrenney this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Dec 20, 2024

@neil-marcellini, @ikevin127, @zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 20, 2024
@ikevin127
Copy link
Contributor

Still awaiting Neil's feedback on #53539 (comment) whether we should fix this on BE side or go the route of a temporary FE fix as suggested by alternative from #53539 (comment).

@melvin-bot melvin-bot bot removed the Overdue label Dec 21, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

@neil-marcellini, @ikevin127, @zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 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 Dec 26, 2024

@neil-marcellini, @ikevin127, @zanyrenney Eep! 4 days overdue now. Issues have feelings too...

@ikevin127
Copy link
Contributor

Still awaiting Neil's feedback on #53539 (comment) whether we should fix this on BE side or go the route of a temporary FE fix as suggested by alternative from #53539 (comment).

@melvin-bot melvin-bot bot removed the Overdue label Dec 26, 2024
@neil-marcellini
Copy link
Contributor

neil-marcellini commented Dec 27, 2024

Wow sorry for the delay guys. I've been OOO, but also please don't hesitate to DM me on Slack. I'm much more likely to see that than GH tags.

What I don't understand is why the app is allowing us to comment on a deleted thread in the first place. That seems like where we should focus our attention. Maybe that has to do with isDeletedParentAction as others have suggested, but I think the problem would occur before adding a comment on the deleted thread. The problem has occurred before that point; after deleting the expense I don't think we should be able to comment on the thread.

I will investigate myself.

@neil-marcellini
Copy link
Contributor

Oh right, so I seem to remember that we allow commenting on deleted expenses because sometimes people like to do that and there's really no need to limit the conversation.

So yes the question is why does AddComment not return the message with isDeletedParentAction. It's also important to note that since the report action message is an array, the merge operation on the report action fully replaces the message array value vs merging the single object, which is why isDeletedParentAction is removed when it was set previously.

I will look into why this isn't sent from the backend when adding a comment

@neil-marcellini neil-marcellini added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor labels Dec 27, 2024
@neil-marcellini
Copy link
Contributor

The fix is up and should be working. I want to make it work for tasks too, manual test, and then I can get the PR ready for review.

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. Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors Internal Requires API changes or must be handled by Expensify staff
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

6 participants