App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Track – Setting expense to unreported in OldDot turn the expense in workspace chat to 0.00

Open lanitochka17 opened this issue 1 year ago • 38 comments

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.24-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/4887079&group_by=cases:section_id&group_order=asc&group_id=309130 Email or phone of affected tester (no customers): [email protected] **Issue reported by:**Applause - Internal Team

Action Performed:

Precondition:

  1. In OldDot - Create an unreported transaction on OldDot
  2. Verify that it shows up on the self-DM in NewDot
  3. In OldDot - add the transaction to a report
  4. Verify it is removed from the self-DM in DM and send to Workspace chat
  5. In OldDot - make the transaction unreported again

Expected Result:

Transaction should be removed from workspace chat and send to self-DM chat again

Actual Result:

Same transaction is present on self-DM chat and workspace chat Sometimes the transaction in workspace chat appears with amount set to 0.00

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/d8ff2715-3aa8-46fb-a165-fba740c7808e

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018a4221d84dcbfb8b
  • Upwork Job ID: 1829267536895122660
  • Last Price Increase: 2024-09-05

lanitochka17 avatar Aug 22 '24 20:08 lanitochka17

Triggered auto assignment to @johncschuster (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[bot] avatar Aug 22 '24 20:08 melvin-bot[bot]

@johncschuster FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

lanitochka17 avatar Aug 22 '24 20:08 lanitochka17

I believe this is part of the same issue and should be fixed along with it. https://github.com/Expensify/App/issues/46287.

My proposal outlines one possible client-side solution.

Amoralchik avatar Aug 22 '24 22:08 Amoralchik

@johncschuster Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Aug 26 '24 18:08 melvin-bot[bot]

Raised in Slack. Keeping at a lower priority while we focus on higher urgency items.

johncschuster avatar Aug 26 '24 22:08 johncschuster

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

melvin-bot[bot] avatar Aug 29 '24 21:08 melvin-bot[bot]

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

melvin-bot[bot] avatar Aug 29 '24 21:08 melvin-bot[bot]

@johncschuster, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Sep 02 '24 18:09 melvin-bot[bot]

Awaiting proposals

aimane-chnaif avatar Sep 02 '24 20:09 aimane-chnaif

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

melvin-bot[bot] avatar Sep 05 '24 16:09 melvin-bot[bot]

@johncschuster @aimane-chnaif 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!

melvin-bot[bot] avatar Sep 05 '24 18:09 melvin-bot[bot]

Hi, I am Michael (Mykhailo) from Callstack, an expert agency and I can work on this issue.

rezkiy37 avatar Sep 10 '24 12:09 rezkiy37

@johncschuster, @aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Sep 10 '24 18:09 melvin-bot[bot]

I am testing the bug.

rezkiy37 avatar Sep 11 '24 15:09 rezkiy37

I've completed the testing. I can confirm that it is a backend bug. There are 2 places to fix:

  1. Pusher: it does not send updates when the user makes the transaction unreported again. Neither the workspace chat nor the self-DM chat receives updates with added/removed expenses.
  2. The backend does not remove unreported transactions from the workspace chat. The backend still includes the transactions and successfully fetches its reports. Also, it duplicates report actions if the user makes the transaction reported again.

We need an internal engineer here 🙂

https://github.com/user-attachments/assets/68898e80-3a63-4b6e-b825-5bc7f88f65e9

cc @johncschuster

rezkiy37 avatar Sep 12 '24 12:09 rezkiy37

Amazing. Thanks for doing that, @rezkiy37! @dylanexpensify beat me to it, and has applied the Internal label. We'll get someone on this ASAP!

johncschuster avatar Sep 12 '24 21:09 johncschuster

@johncschuster, @rezkiy37, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Sep 13 '24 18:09 melvin-bot[bot]

@johncschuster, @rezkiy37, @aimane-chnaif 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Sep 17 '24 18:09 melvin-bot[bot]

@dylanexpensify can you help me prioritize this internally?

johncschuster avatar Sep 17 '24 21:09 johncschuster

@johncschuster @rezkiy37 @aimane-chnaif this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar Sep 19 '24 18:09 melvin-bot[bot]

Chatted in Slack about this one. We agree this is still worth fixing, but it's currently a lower priority while we focus on more urgent things.

johncschuster avatar Sep 20 '24 15:09 johncschuster

Issue not reproducible during KI retests. (First week)

mvtglobally avatar Sep 21 '24 04:09 mvtglobally

@johncschuster, @rezkiy37, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Sep 23 '24 18:09 melvin-bot[bot]

Great! Let's wait one more week. If not reproducible, we can close the issue.

johncschuster avatar Sep 24 '24 21:09 johncschuster

We need a retest on this, but it looks like we should wait until the next deploy

johncschuster avatar Oct 03 '24 21:10 johncschuster

I just retested this and it's very reproducible.

In OldDot - Create an unreported transaction on OldDot Verify that it shows up on the self-DM in NewDot

👍

In OldDot - add the transaction to a report

Screenshot 2024-10-11 at 11 07 01 AM

Personal DM lastMessageText is wrong. Also, should the Workspace Chat say tracked $666.00 ?

When I refresh the page this is what I see...

Screenshot 2024-10-11 at 11 11 29 AM

Note: The expense on the Workspace chat also still says "Unreported" - which is another thing to fix.

Screenshot 2024-10-11 at 11 11 15 AM

Which seems correct 👍

In OldDot - make the transaction unreported again Transaction should be removed from workspace chat and send to self-DM chat again

Yes, well, this doesn't happen. In fact, nothing happens.

Screenshot 2024-10-11 at 11 13 04 AM

But when you refresh the page we get this:

Screenshot 2024-10-11 at 11 13 54 AM Screenshot 2024-10-11 at 11 14 06 AM

I think what we should do is break this up into a few separate tasks and address each one at a time.

marcaaron avatar Oct 11 '24 21:10 marcaaron

Oh there's also this other bug...

Loading state shown incorrectly

  1. Create a new account in NewDot
  2. Create a workspace
  3. Sign in on OldDot
  4. Create an unreported expense
  5. Verify that the expense shows in the self DM in NewDot 💥 we see a loading indicator...

Screenshot 2024-10-11 at 12 20 43 PM

Why it happens...

The transaction itself appears to not get sent to the client...

Screenshot 2024-10-11 at 12 24 50 PM

Fixing it here

  • [ ] https://github.com/Expensify/Auth/pull/12752

marcaaron avatar Oct 11 '24 22:10 marcaaron

Adding unreported transaction to report

  1. Add unreported transaction to report in OldDot
  2. Verify that it is removed from the selfDM lastMessageText
  3. Verify that it is moved to the Workspace Chat
  4. Verify the Workspace Chat text says "tracking $total” and not “tracked”
  5. Verify the Workspace shows the correct report preview
  6. Verify that the transaction no longer says “Unreported”.
  • [ ] TODO

Removing previously reported transaction by marking it as unreported

  1. Remove reported transaction by unreporting it in OldDot
  2. Verify that it is removed from the Workspace Chat and lastMessageText updated correctly
  3. Verify that it is moved to the selfDM and lastMessageText updated correctly
  4. Verify the Self DM LHN says “tracked $total” and not “tracking $total”
  5. Verify the Workspace shows the empty state again
  6. Verify that the transaction shows in the Self DM and says “Unreported”
  • [ ] TODO

marcaaron avatar Oct 12 '24 02:10 marcaaron

Checking into some more stuff on the backend for this one...

It looks we do set the money request report preview with an update like this:

{
    "key": "reportActions_1229374452552951",
    "onyxMethod": "merge",
    "value": {
        "5017207174434834948": {
            "message": [
                {
                    "deleted": "2024-10-16 02:00:57.518",
                    "type": "TEXT"
                }
            ],
            "originalMessage": {
                "deleted": "2024-10-16 02:00:57.518"
            }
        }
    }

Though, in my local testing the issue persists. The LHN text also remains out of date even though the update appears to get queued from the backend.

Spent many hours with this. This flow is a bit complex and very broken so it may take some more time to figure it all out.

marcaaron avatar Oct 16 '24 03:10 marcaaron

One problem appears to be while updates are queued in Auth they are never returned to the web API so that they can be sent in realtime.

Even if we start queuing the correct updates the user won't see them until they take some action. Asked in Slack if this is expected as I have not worked much on a compatibility issue like this before.

marcaaron avatar Oct 17 '24 03:10 marcaaron