Skip to content

Chat - Unread marker moves to first message sent offline when returning online #47481

Closed

Description

@IuliiaHerets

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: 9.0.20.6
Reproducible in staging?: Y
Reproducible in production?: N
Issue was found when executing this PR #47393
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/ and log in
  2. Open any chat
  3. Disable the internet connection
  4. Send a few message
  5. Mark any message unread, but not the first one that was sent
  6. Enable the internet connection

Expected Result:

The unread marker stays above the message that was selected unread

Actual Result:

The unread marker moves up to the first message that was sent while offline

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6572560_1723686265041.Recording__684.mp4

View all open jobs on GitHub

Activity

  1. added
    Bug
    DeployBlocker
    on Aug 15, 2024
  2. melvin-bot commented on Aug 15, 2024

    @melvin-bot

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

  3. IuliiaHerets commented on Aug 15, 2024

    @IuliiaHerets
    Author

    We think that this bug might be related to #vip-vsb

  4. nkdengineer commented on Aug 15, 2024

    @nkdengineer
    Contributor

    Proposal

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

    The unread marker moves up to the first message that was sent while offline

    What is the root cause of that problem?

    When we mark as unread an action offline, unreadMarkerTime is assigned as the client's created time of the action. Then when we online, BE returns the db created time of the action that is more than the client's created time. So the unread marker is moved up.

    const [unreadMarkerTime, setUnreadMarkerTime] = useState(report.lastReadTime ?? '');

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

    We should update shouldDisplayNewMarker function to check if we already have an unread marker action we only check the reportActionID is matched with unreadMarkerReportActionID or not

    if (!unreadMarkerReportActionID) {
        // the current logic
    } else {
        return reportAction.reportActionID === unreadMarkerReportActionID
    }
    

    const shouldDisplayNewMarker = (reportAction: OnyxTypes.ReportAction, index: number): boolean => {

    What alternative solutions did you explore? (Optional)

  5. added
    DeployBlockerCash
    and removed
    DeployBlocker
    on Aug 15, 2024
  6. melvin-bot commented on Aug 15, 2024

    @melvin-bot

    Triggered auto assignment to @iwiznia (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  7. github-actions commented on Aug 15, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  8. 63 remaining items

  9. johncschuster commented on Feb 4, 2025

    @johncschuster
    Contributor

    Still low priority

  10. johncschuster commented on Mar 11, 2025

    @johncschuster
    Contributor

    Same

  11. added
    Reviewing
    Weekly
    and removed on Mar 20, 2025
  12. iwiznia commented on Mar 20, 2025

    @iwiznia
    Contributor

    I implemented all that we discussed above, but the exact OG issue described here is not fixed due to this.
    It does improve on this and fixes other slightly different bug that you can see here in test 2.

    Will wait to see if Utkersh Rajvenshi (don't have their GH handle) has any ideas on how to solve this.

  13. iwiznia commented on Mar 26, 2025

    @iwiznia
    Contributor

    ok PRs are merged, the OG issue is not yet solved, but @utkershrajvenshi said he will take a look

  14. Julesssss commented on Mar 31, 2025

    @Julesssss
    Contributor

    We have a new deploy blocker where the unread marker shows above your own comments and it seems possibly related.

    Reverting the Change MarkAsUnread to pass reportActionID instead of time App changes didn't resolve the issue and I'm currently unable to reproduce locally 😕

  15. self-assigned this
    on Apr 1, 2025
  16. Julesssss commented on Apr 1, 2025

    @Julesssss
    Contributor

    Resolved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugEngineeringReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions