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

[$500] Some reports are not loading and get in a loop of calling OpenReport #35620

Closed
1 of 6 tasks
m-natarajan opened this issue Feb 2, 2024 · 44 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Feb 2, 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.35-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @cead22
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1706816577968589

Action Performed:

  1. Open some of the reports (one of the reproducing step is on an account where the other user was no longer a member of the workspace)

Expected Result:

Open the chat without any issues

Actual Result:

Loading screen appears and get in a loop of calling OpenReport
Few of the affected ReportIDs : 66604416, 65279538 and 66589491

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

2024-02-01_14-02-20.mp4

image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b0c48a8c47035913
  • Upwork Job ID: 1753235697020526592
  • Last Price Increase: 2024-02-02
@m-natarajan m-natarajan 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 Feb 2, 2024
@melvin-bot melvin-bot bot changed the title Some reports are not loading and get in a loop of calling OpenReport [$500] Some reports are not loading and get in a loop of calling OpenReport Feb 2, 2024
Copy link

melvin-bot bot commented Feb 2, 2024

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

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

melvin-bot bot commented Feb 2, 2024

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

Copy link

melvin-bot bot commented Feb 2, 2024

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

@cead22 cead22 self-assigned this Feb 2, 2024
@cead22 cead22 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 Help Wanted Apply this label when an issue is open to proposals by contributors labels Feb 2, 2024
Copy link

melvin-bot bot commented Feb 2, 2024

Current assignee @thesahindia is eligible for the Internal assigner, not assigning anyone new.

@cead22
Copy link
Contributor

cead22 commented Feb 2, 2024

I've been looking into this today but still haven't figured out the root cause

@melvin-bot melvin-bot bot added the Overdue label Feb 5, 2024
@cead22
Copy link
Contributor

cead22 commented Feb 6, 2024

  • Looking into the code, and onEndReached={loadOlderChats} got me thinking that this is why having a message after all the deleted ones makes the report load. But I couldn't prove that
  • Deleting the onyx key reportActions_65630295 didn't fix the issue. Signing out and back in didn't fix the issue either

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Feb 6, 2024
Copy link

melvin-bot bot commented Feb 9, 2024

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

Copy link

melvin-bot bot commented Feb 13, 2024

@cead22, @puneetlath, @thesahindia Still overdue 6 days?! Let's take care of this!

@cead22
Copy link
Contributor

cead22 commented Feb 14, 2024

@iwiznia did you happen to look into this?

I have no updates on this one yet

@melvin-bot melvin-bot bot removed the Overdue label Feb 14, 2024
Copy link

melvin-bot bot commented Feb 16, 2024

@cead22 @puneetlath @thesahindia this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Feb 16, 2024
Copy link

melvin-bot bot commented Feb 19, 2024

@cead22, @puneetlath, @thesahindia Huh... This is 4 days overdue. Who can take care of this?

@puneetlath
Copy link
Contributor

@cead22 is this most likely a back-end issue?

@melvin-bot melvin-bot bot removed the Overdue label Feb 19, 2024
@cead22
Copy link
Contributor

cead22 commented Feb 20, 2024

This was triggered by a back end change (https://github.com/Expensify/Insiders/issues/8824), but the client should be able to handle that update. I haven't figured this one out yet

Copy link

melvin-bot bot commented Mar 4, 2024

📣 @kbieganowski! 📣
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>

@kbieganowski
Copy link
Contributor

Hey @cead22, I've tried to reproduce this issue but unfortunately with no luck, removing user from the workspace and opening it from the link didn't cause mentioned issue either. Can you please provide us repro steps and recording (if possible)?

@cead22
Copy link
Contributor

cead22 commented Mar 4, 2024

This is a tricky one to reproduce, but the way we triggered this was by updating our database to delete some messages in some DM chats using the following query

update reportactions set message = json_set(json_set(message, '$.edits[#]', message->>'$.html'), '$.html', '') where reportID = {0} and action = 'ADDCOMMENT' and message->>'$.html' is not null and message->>'$.html' != ''

When opening a DM chat that got messages deleted, we get in a loop of making api requests to GetOlderActions

@melvin-bot melvin-bot bot removed the Overdue label Mar 4, 2024
@kbieganowski
Copy link
Contributor

Could you please elaborate more on how I can run this query? Otherwise, I'm not able to reproduce this issue

@cead22
Copy link
Contributor

cead22 commented Mar 5, 2024

@kbieganowski I messaged you yesterday in new dot from my [email protected] account (https://staging.new.expensify.com/r/328657243571140). I'm going to add a lot of messages to that chat, and then I'll run that query for the chat and see if we can get you to reproduce

@cead22
Copy link
Contributor

cead22 commented Mar 5, 2024

@puneetlath buddy check please

update reportactions set message = json_set(json_set(message, '$.edits[#]', message->>'$.html'), '$.html', '') where reportID = 328657243571140 and action = 'ADDCOMMENT' and message->>'$.html' is not null and message->>'$.html' != ''

@puneetlath
Copy link
Contributor

Looks good 👍🏾

@cead22
Copy link
Contributor

cead22 commented Mar 5, 2024

Done, verification below

[email protected]:~$ sudo readdb.sh "select count() from reportactions where reportid = 328657243571140 and action = 'ADDCOMMENT' and message->>'$.html' is  not null and message->>'$.html' = ''"
count()
-------
2214
[email protected]:~$ sudo readdb.sh "select count() from reportactions where reportid = 328657243571140 and action = 'ADDCOMMENT' and message->>'$.html' is  not null and message->>'$.html' != ''"
count()
-------
0

@cead22
Copy link
Contributor

cead22 commented Mar 5, 2024

@kbieganowski I'm able to reproduce by switching to the DM report between [email protected] and [email protected].

Let me know if you can reproduce as well

@kbieganowski
Copy link
Contributor

Hi @cead22, unfortunately I wasn't able to reproduce this issue in staging as well. I've also tried switching between multiple reports at fast rate and going back to mentioned one but without any luck

after_query.mp4

@cead22
Copy link
Contributor

cead22 commented Mar 6, 2024

@kbieganowski can you try signing out and back in? Those messages you're seeing should all be deleted. Also feel free to ping me on slack or new expensify if that's quicker

@cead22
Copy link
Contributor

cead22 commented Mar 6, 2024

I'm currently seeing GetOlderActions being called over and over when I switch to that chat

@iwiznia
Copy link
Contributor

iwiznia commented Mar 6, 2024

Not sure if related but see #fireroom-2024-03-06-public-rooms-spamming-getolderactions

@cead22
Copy link
Contributor

cead22 commented Mar 6, 2024

Ha, I just posted a question in there 👍

@cead22
Copy link
Contributor

cead22 commented Mar 6, 2024

It looks like the same issue that is happening here for deleted messages happens in chats with whispers, and we're going to push a change to solve the issues for whispers. I'll test again to see if I can reproduce once the fix is out to see if it fixes this issue as well

@roryabraham
Copy link
Contributor

seems plausible that this might be fixed by #37839

@cead22
Copy link
Contributor

cead22 commented Mar 6, 2024

It looks like we fixed the case where we call GetOlderActions over and over, which is the case I was able to reproduce with the chat between [email protected] and [email protected].

That said, I'm still seeing this issue with reports that trigger OpenReport over and over, but I need to figure out steps to reproduce

@melvin-bot melvin-bot bot added the Overdue label Mar 11, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

@cead22, @puneetlath Eep! 4 days overdue now. Issues have feelings too...

@puneetlath
Copy link
Contributor

@cead22 shall we drop this to a weekly in that case?

@cead22
Copy link
Contributor

cead22 commented Mar 20, 2024

This was fixed while fixing a fire. I tried reproducing with all the reports that I was able to reproduce with before and didn't manage, so closing

@puneetlath
Copy link
Contributor

Nice!

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. Engineering Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
No open projects
Status: CRITICAL
Development

No branches or pull requests

7 participants