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.34k stars 2.77k forks source link

[UX Reliability] The LHN is out of sync across multiple platforms #48149

Open mountiny opened 3 weeks ago

mountiny commented 3 weeks 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: v9.0.25-10 Reproducible in staging?: Reproducible in production?: 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: @quinthar Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1724780554260709

Action Performed:

Break down in numbered steps

  1. Use the app in multiple platforms using the same account
  2. Notice the order of the LHN chats on each platform after some time

Expected Result:

Describe what you think should've happened

the LHN order should stay at sync at all times across platforms. The onyx updates should ensure all clients have all the necessary data

Actual Result:

Describe what actually happened

The LHN got out of sync

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

melvin-bot[bot] commented 3 weeks ago

Triggered auto assignment to @jliexpensify (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] commented 3 weeks ago

Triggered auto assignment to @carlosmiceli (AutoAssignerNewDotQuality)

OlimpiaZurek commented 3 weeks ago

Hi! I'm Olimpia from Callstack and I would like to work on this issue.

carlosmiceli commented 3 weeks ago

@mountiny since Olimpia picked it up, should I remain as reviewer? I think I only got one AutoAssignerNewDotQuality issue assigned so far, so not sure I remember how it works in this case.

muttmuure commented 3 weeks ago

Here's an SO that will help out! https://stackoverflowteams.com/c/expensify/questions/19512

Olimpia will lead but may have questions about the back end that you will need to source answers for

carlosmiceli commented 3 weeks ago

@muttmuure thanks man! I didn't connect the dots between Calstack <-> "agency engineer" in the SO, perfect. I'll support Olimpia in every way I can 💪

OlimpiaZurek commented 3 weeks ago

I've been investigating this issue and have encountered difficulties reproducing it.

The LHN appears to be synced across various devices (I have checked both development and staging, as I do not have access to the hybrid app).

The only inconsistency I noticed is that when I receive a new message and then perform a "clear cache and restart on client" on one device, the message's unread status is cleared on this device but remains marked as "unread" on the other device, leading to an unsynced state across different devices.

I am still waiting for the exported Onyx state from David's devices so that I can analyze the data and determine the cause of this issue.

carlosmiceli commented 3 weeks ago

@OlimpiaZurek Understood, it does seem that it's not happening lately since Jason said here he doesn't see the issue anymore either. Let's give David until early next week to send us his Onyx state, or we can follow up with him then.

carlosmiceli commented 2 weeks ago

Will follow up with David :)

carlosmiceli commented 2 weeks ago

@OlimpiaZurek I see that David shared the onyx state, let me know if you have any questions!

OlimpiaZurek commented 2 weeks ago

Daily update:

I started analyzing the Onyx state data across different platforms and environments using the files provided by David:

During the analysis, I noticed that most items were displayed in the correct order, but I identified some discrepancies in the Onyx state data for certain reports that are inconsistently displayed on the LHN across platforms.

Detailed examples of the issues observed:

New Expensify App (Android):

"report_7177703019320414": {
  "isPinned": true
}

Other Platforms:

   "report_7177703019320414": {
    "reportID": "7177703019320414",
    "reportName": "",
    "type": "chat",
    "chatType": "policyExpenseChat",
    "ownerAccountID": 1,
    "managerID": 0,
    "policyID": "0CFE78B25EBE2A0A",
    "participants": {
      "1": {
        "hidden": false,
        "notificationPreference": "always"
      },
      "778531": {
        "hidden": false,
        "notificationPreference": "always"
      },
      "9645353": {
        "hidden": false,
        "notificationPreference": "always"
      },
      "10903701": {
        "hidden": false,
        "notificationPreference": "always"
      }
    },
    "participantAccountIDs": {},
    "visibleChatMemberAccountIDs": {},
    "isPinned": true,
    "lastReadTime": "2024-02-27 16:48:03.527",
    "lastReadSequenceNumber": 0,
    "lastVisibleActionCreated": "2024-02-27 13:50:10.163",
    "lastVisibleActionLastModified": "2024-02-27 13:50:10.163",
    "lastMessageText": "😉",
    "lastActionType": "ADDCOMMENT",
    "lastActorAccountID": 778531,
    "notificationPreference": "always",
    "stateNum": 0,
    "statusNum": 0,
    "oldPolicyName": "",
    "private_isArchived": "",
    "isOwnPolicyExpenseChat": true,
    "lastMessageHtml": "😉",
    "hasOutstandingChildRequest": false,
    "hasOutstandingChildTask": false,
    "policyName": "NewDot Test - Expensify US",
    "writeCapability": "all",
    "description": "",
    "total": 0,
    "unheldTotal": 0,
    "currency": "USD",
    "isWaitingOnBankAccount": false,
    "nonReimbursableTotal": 0,
    "isCancelledIOU": false,
    "avatarUrl": "",
    "errorFields": {}
  },

Screenshots: New Expensify:

new_expensify

Hybrid App:

hybrid_app_

staging on desktop web, Chrome:

web_desktop

mobile web Android Chrome staging:

web_android

Further investigation into the data syncing and Onyx state update processes is needed to determine the exact root cause and resolve these discrepancies.

carlosmiceli commented 2 weeks ago

Hi @OlimpiaZurek, thought I'd share this latest comment on slack: https://expensify.slack.com/archives/C05LX9D6E07/p1725631656709919

OlimpiaZurek commented 1 week ago

@carlosmiceli I reviewed the conversation on Slack and noticed that my observations align with the issue mentioned there, as the discrepancy seems to be related to unread chats appearing on LHN. I also found that some reports referenced in my previous comment are missing a lastReadTime, which seems to be the underlying cause of the problem.

Apart from that, I’m still struggling to reproduce the LHN out-of-sync issue across multiple platforms. However, this ordering issue may be related to the same root cause.

carlosmiceli commented 1 week ago

Missing read time definitely is a great theory! Sharing on slack to see how to move forward 💪

carlosmiceli commented 1 week ago

Moving this to internal to investigate what's happening with the payload that doesn't always include lastReadTime.

carlosmiceli commented 1 week ago

This upcoming PR may fix this, so will move this to Weekly and will monitor its development.

melvin-bot[bot] commented 1 week ago

@carlosmiceli @OlimpiaZurek @jliexpensify 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!

carlosmiceli commented 1 day ago

Still waiting on the PR above.