Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.29k stars 2.73k forks source link

iOS client inbox is not in sync with web client. #44758

Closed m-natarajan closed 1 month ago

m-natarajan commented 2 months ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: Reproducible in staging?: Needs reproduction Reproducible in production?: Needs reproduction 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: @muttmuure Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1719833472233469

Action Performed:

  1. Log to iOS and web with high traffic account
  2. In iOS approve or pay any iou
  3. Send a message as user B to A and read the message in iOS

    Expected Result:

    Both iOS and Web client are updated in real time when reading the message or approving a report

    Actual Result:

    iOS not synching with web

Workaround:

unknown

Platforms:

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

Screenshots/Videos

View all open jobs on GitHub

melvin-bot[bot] commented 2 months ago

Current assignee @muttmuure is eligible for the Bug assigner, not assigning anyone new.

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @lakchote (AutoAssignerNewDotQuality)

m-natarajan commented 2 months ago

44683

lakchote commented 2 months ago

Unable to reproduce, I've posted details on reproduction steps here. Tests done on new staging version deployed yesterday.

lakchote commented 2 months ago

Asked for a way to reliably reproduce it here, as I haven't been able to.

lakchote commented 2 months ago

@muttmuure do you still encounter the problem or not?

muttmuure commented 2 months ago

Yes, unfortunately I don't think we've fixed the root cause of this

lakchote commented 2 months ago

Asked for external expert help here, to speed up the resolution.

lakchote commented 1 month ago

@jnowakow will help on this one.

muttmuure commented 1 month ago

@jnowakow can you comment on the issue and I'll assign you?

jnowakow commented 1 month ago

Hello, sorry for late response. You can assign me to this one :)

SzymczakJ commented 1 month ago

Since Jan has some other work to finish, I will be taking over this issue, can you reassing it to me?

muttmuure commented 1 month ago

done

SzymczakJ commented 1 month ago

I can't reproduce this issue(even on high traffic account and with lots of messages unread), is this something that happens every time on your account, or maybe this bug happens after some time, or maybe it seems random and happens only from time to time?

lakchote commented 1 month ago

I can't reproduce this issue(even on high traffic account and with lots of messages unread), is this something that happens every time on your account, or maybe this bug happens after some time, or maybe it seems random and happens only from time to time?

That's the tricky part, I wasn't able to reproduce either.

From what @muttmuure told me, it doesn't happen every time which complicates the reproduction steps.

muttmuure commented 1 month ago

I think that what might be happening is that on poor connections Ping and ReconnectApp are causing the sequential queue to break/flush and we're dropping updates when the connection is live again. This means that your mobile app will have a list of chats that were meant to be updated but were not.

There is a PR to fix this: https://github.com/Expensify/App/issues/44269

Let's see if fixing Ping and ReconnectApp fixes this, if it doesn't then we'll need to consider why getting the Onyx updates is failing

SzymczakJ commented 1 month ago

Tried to reproduce for about 2 hours and failed to do so. I'll try once more when https://github.com/Expensify/App/issues/44269 fails to fix this issue. Is it okay with you?

muttmuure commented 1 month ago

I wonder if we can reproduce this with these steps

Receive messages to iOS

Go offline on iOS

Create a queue of 11 failed Pings/ReconnectApp back to back using network throttling

Queue a successful Ping/ReconnectApp

Mark the message as read on web (maybe we should try this during the failing network requests on mobile too?)

See if the status syncs over

SzymczakJ commented 1 month ago

I'll try these steps as a first thing on Monday, because today all of SWM is leaving for a integration trip and I'm working shorter hours 😃

lakchote commented 1 month ago

@SzymczakJ will test this morning if the reproduction steps above are working or not.

PR that possibly fix this is still open.

SzymczakJ commented 1 month ago

Tried these reproduction steps and everything seems to work fine. Clamped sequential queue with 13 failed ReconnectApp requests, then went back to online on iOS and read the message on web. App flushed the sequential queue and when queue length became 0 iOS synced successfully with web. Maybe let's wait for that PR that Lucien mentioned? WDYT?

muttmuure commented 1 month ago

Can we try reading the message during the series of failed ReconnectApp requests?

SzymczakJ commented 1 month ago

I've read the message when iOS was going over all the stacked ReconnectApp requests. Initially the message wasn't shown as read on iOS, only after the App made a successful ReconnectApp request the message got updated and became "read". The message finally got it's status updated so I think this is a correct behaviour

muttmuure commented 1 month ago

OK, so it's something else then - thanks for looking.

melvin-bot[bot] commented 1 month ago

@lakchote @muttmuure @SzymczakJ 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!

lakchote commented 1 month ago

We're not close to a solution since we can't reproduce the bug reliably.

Other cases of a sync problem happening:

@SzymczakJ were you able to reproduce it at least once or not?

Asked in #expensify-open-source if someone has encountered the same problem already or not, to see if we can deduce the steps to reproduce the bug.

muttmuure commented 1 month ago

I'm concerned that this still happens, but without reproduction steps it's hard to know how to proceed

muttmuure commented 1 month ago

I think that this is caused by the Clear Cache and Restart tool in the Troubleshoot menu.

If you use that tool, your updated LHN is not synced across devices (which makes sense) and so it seems like they are out of sync (but that has been forced)