Skip to content

After sending a message in offline mode and going back to online, messages are repeated when refreshing the page #2451

Closed

Description

@isagoico

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


Expected Result:

Only 1 message should be displayed.

Actual Result:

Message is sent twice when refreshing the page after coming back online.

Action Performed:

  1. Log in to staging.expensify.cash
  2. Navigate to a conversation
  3. Disable the internet connection
  4. Send a message while offline
  5. Enable the internet connection and immediately refresh the page

Workaround:

If the user does not refresh the page only 1 message is displayed.

Platform:

Where is this issue occurring?

Web ✔️
iOS
Android
Desktop App
Mobile Web

Version Number: 1.0.24-1

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos:

OFFLINE.mp4

Expensify/Expensify Issue URL:


From @parasharrajat https://expensify.slack.com/archives/C01GTK53T8Q/p1618602399353800

ISSUE: After sending a message in offline mode and going back to online, messages is repeated(sent twice).

Upwork job: https://www.upwork.com/jobs/~0151bfc06bb91fc01c

Activity

  1. added
    AutoAssignerTriage
    on Apr 19, 2021
  2. MelvinBot commented on Apr 19, 2021

    @MelvinBot
    Contributor

    Triggered auto assignment to @sonialiap (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

  3. removed
    AutoAssignerTriage
    on Apr 19, 2021
  4. parasharrajat commented on Apr 19, 2021

    @parasharrajat
    Member

    @isagoico I think this video is not working. It would be better to just attach the video link. Converting Webm to mp4 has some issues.

  5. parasharrajat commented on Apr 20, 2021

    @parasharrajat
    Member

    @isagoico Working video

    video.mp4
  6. marcaaron commented on Apr 22, 2021

    @marcaaron
    Contributor

    Nice catch @parasharrajat. Guessing we are just not clearing the queue out once the queue is allowed to run here?

    I think we were mainly focused on the case of:

    1. Go offline
    2. Leave a comment
    3. Refresh page
    4. Go online
    5. Comment is sent
  7. parasharrajat commented on Apr 22, 2021

    @parasharrajat
    Member

    @marcaaron Yes. message queue should be cleared when the queued messages are processed after user comes back online.

    But one important point to take is that we should only process the queue when the client is leader.

    I have tested it. Proposal is ready.

    Even queue processing should be done by leader as we share the localhost across tabs

  8. marcaaron commented on Apr 22, 2021

    @marcaaron
    Contributor

    Ok, I think we can skip most of triage then and get this fast tracked.

  9. added
    External
    on Apr 22, 2021
  10. MelvinBot commented on Apr 22, 2021

    @MelvinBot
    Contributor

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

  11. parasharrajat commented on Apr 29, 2021

    @parasharrajat
    Member

    Are we ready to move on this one? I am willing to fix this.

  12. puneetlath commented on May 3, 2021

    @puneetlath
    Contributor

    Sorry for the delay Rajat. Here's the job: https://www.upwork.com/jobs/~0151bfc06bb91fc01c

  13. 21 remaining items

  14. added
    Daily
    and removed on Aug 26, 2021
  15. mallenexpensify commented on Aug 26, 2021

    @mallenexpensify
    Contributor

    Reopened. Thanks for following up Rajat, I somehow didn't notice the issue had been closed before.
    Paying the $250 now. I was able to reproduce the issue on web - staging, this morn. Not sure if it's the exact same issue or a different one :/

  16. mallenexpensify commented on Aug 26, 2021

    @mallenexpensify
    Contributor

    @parasharrajat the old posting was closed and I couldn't pay on it. Can you submit a proposal for this job then comment here and I'll pay today? https://www.upwork.com/jobs/~01ddd43b69a1376ed2

  17. parasharrajat commented on Aug 26, 2021

    @parasharrajat
    Member

    Sorry, I have another contract open here https://www.upwork.com/jobs/Messages-are-sent-twice-when-there-unstable-internet-connection-4214_%7E018c22cb61e93a114c.
    Please close the new one and Proceed with the old one.

    Also, you mentioned you were able to reproduce the issue. so Did messages get repeated on refreshing the page?
    There is another issue here #4766

  18. mallenexpensify commented on Aug 26, 2021

    @mallenexpensify
    Contributor

    That one is set to pay in a few days so I'll just let that 'run it's course' and close this. Sound good?

  19. parasharrajat commented on Aug 26, 2021

    @parasharrajat
    Member

    Ok, sure. Anything works but am I eligible for a bonus here, I reported the issue? I didn't create it as I was not familiar with the bonus part at that time when this issue was created 5 months back.

    But it is good if you can release the payment today for that contract. 🙏

  20. mallenexpensify commented on Aug 26, 2021

    @mallenexpensify
    Contributor

    Paid the other one. Unfortunately the bonus is only available for creating issues in GH, at least up til now.
    Closing this, reopen if needed

  21. parasharrajat commented on Aug 26, 2021

    @parasharrajat
    Member

    Sorry @mallenexpensify But this is not a duplicate of #4214. This is issue happens when the page is refreshed but other when there are internet issues.

    Both are different issues. In my last comment, I was talking about the two contracts for this job on the Upwork.

  22. parasharrajat commented on Aug 26, 2021

    @parasharrajat
    Member

    Also about creating the GH issue, All of the content on the issue description was provided by me. Even the reproduction steps so I still think that It should be eligible for that Bonus but thanks for the consideration.

  23. mallenexpensify commented on Oct 14, 2021

    @mallenexpensify
    Contributor

    Chatted with @parasharrajat 1:1 about this, he was not compensated for reporting or fixing this specific issue because payment of $250 was issued for #4214 (without bonus) so adding $250 as a bonus for reporting the issue (and... fixing it with a PR that fixed both issues.)

  24. parasharrajat commented on Oct 14, 2021

    @parasharrajat
    Member

    Thanks, @mallenexpensify. Appreciate it.

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

Metadata

Metadata

Labels

DailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions