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

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

Closed
isagoico opened this issue Apr 19, 2021 · 31 comments · Fixed by #2703
Assignees
Labels
Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@isagoico
Copy link

isagoico commented Apr 19, 2021

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

@isagoico isagoico added the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Apr 19, 2021
@MelvinBot
Copy link

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

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Apr 19, 2021
@parasharrajat
Copy link
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.

@parasharrajat
Copy link
Member

@isagoico Working video

video.mp4

@marcaaron
Copy link
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

@parasharrajat
Copy link
Member

parasharrajat commented Apr 22, 2021

@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

@marcaaron
Copy link
Contributor

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

@marcaaron marcaaron added the External Added to denote the issue can be worked on by a contributor label Apr 22, 2021
@MelvinBot
Copy link

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

@parasharrajat
Copy link
Member

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

@puneetlath
Copy link
Contributor

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

1 similar comment
@puneetlath
Copy link
Contributor

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

@MelvinBot
Copy link

Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@parasharrajat
Copy link
Member

@puneetlath Applied, Thanks.

@mallenexpensify
Copy link
Contributor

Closing, @parasharrajat was paid for this on Jun 25. Reopen and add comment if needed

@parasharrajat
Copy link
Member

@mallenexpensify Sorry I am not yet paid for this. Also, PR is in progress which I planning to finish as soon as possible.

@puneetlath puneetlath reopened this Jul 28, 2021
@mallenexpensify
Copy link
Contributor

Sorry @parasharrajat . I'm going to blame it on Upwork :)
The way they show contracts and payments can be tricky sometimes (even though, looking at this job again, it's clear you haven't been paid, apologies again)

@MelvinBot MelvinBot added the Monthly KSv2 label Jul 29, 2021
@MelvinBot

This comment has been minimized.

@parasharrajat
Copy link
Member

@MelvinBot I am actually working on this. If you think so you can do that. So kind of you. 😉

@mallenexpensify
Copy link
Contributor

@MelvinBot apologizes, he was running a test

@mallenexpensify
Copy link
Contributor

This is a $250 job in Upwork, does that amount still feel fair? Seems like this issue and the corresponding PR took a lot of time and work. cc @tgolen @marcaaron @parasharrajat

@parasharrajat
Copy link
Member

parasharrajat commented Aug 13, 2021

@mallenexpensify This is your call. As you pointed out, I originally reported the issue as well but didn't create the GH issue so can't really justify the bonus. But yeah PR had a lot of back & forth.

image

Also, you can open this issue as payment is still pending.

@parasharrajat
Copy link
Member

@mallenexpensify Any update on Upwork for this task keeping this #2451 (comment) in mind?

@mallenexpensify
Copy link
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 :/

@mallenexpensify
Copy link
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

@parasharrajat
Copy link
Member

parasharrajat commented Aug 26, 2021

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

@mallenexpensify
Copy link
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?

@parasharrajat
Copy link
Member

parasharrajat commented Aug 26, 2021

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. 🙏

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Aug 26, 2021

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

@parasharrajat
Copy link
Member

parasharrajat commented Aug 26, 2021

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.

@parasharrajat
Copy link
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.

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Oct 14, 2021

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.)

@parasharrajat
Copy link
Member

Thanks, @mallenexpensify. Appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
8 participants