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

web.whatsapp.com - Unable to paste text copied from certain sources into the message box (e.g. notepad) #125920

Closed
webcompat-bot opened this issue Aug 17, 2023 · 24 comments
Labels
browser-firefox engine-gecko The browser uses the Gecko rendering engine os-win11 Issues that are reproducible only on Windows 11 priority-normal severity-critical The site or core functionality is unusable, or you would probably open another browser to use it. trend-clipboard OKR Label - Issues where operations with copy/paste/cut/select text are failing type-clipboard Issue with navigator.clipboard
Milestone

Comments

@webcompat-bot
Copy link

webcompat-bot commented Aug 17, 2023

URL: https://web.whatsapp.com/

Browser / Version: Firefox 116.0
Operating System: Windows 11
Tested Another Browser: Yes Chrome

Problem type: Something else
Description: I often copy and paste into WhatsApp from Windows 11 in Firefox. It has stopped working. I cannot paste into WhatsApp Web now.
Steps to Reproduce:
I had no problem copying and pasting into whatsapp web in Chrome

Browser Configuration
  • None

From webcompat.com with ❤️

@webcompat-bot webcompat-bot added the action-needsmoderation The moderation has not yet been completed label Aug 17, 2023
@webcompat-bot webcompat-bot added this to the needstriage milestone Aug 17, 2023
@webcompat-bot webcompat-bot added the browser-fixme This requires manual assignment for the browser name label Aug 17, 2023
@webcompat-bot webcompat-bot changed the title In the moderation queue. web.whatsapp.com - see bug description Aug 17, 2023
@webcompat-bot webcompat-bot added browser-firefox priority-critical engine-gecko The browser uses the Gecko rendering engine and removed browser-fixme This requires manual assignment for the browser name action-needsmoderation The moderation has not yet been completed labels Aug 17, 2023
@softvision-raul-bucata softvision-raul-bucata added the os-win11 Issues that are reproducible only on Windows 11 label Aug 17, 2023
@sv-calin
Copy link

Thank you for reporting this issue, I was able to reproduce it.

paste.text.mp4

Tested on:
• Browser / Version: Firefox Nightly 118.0a1 (2023-08-16) / Firefox Release 116.0.2 / Chrome 116.0.5845.97
• Operating System: Windows 11

Notes:

  1. Reproducible on both Firefox Release and Nightly
  2. Not reproducible on Chrome

Moving to Needsdiagnosis.

[qa_33/2023]

@sv-calin sv-calin changed the title web.whatsapp.com - see bug description web.whatsapp.com - Unable to paste text copied from certain sources into the message box (e.g. notepad) Aug 17, 2023
@sv-calin sv-calin added priority-normal severity-critical The site or core functionality is unusable, or you would probably open another browser to use it. type-clipboard Issue with navigator.clipboard and removed priority-critical labels Aug 17, 2023
@sv-calin sv-calin modified the milestones: needstriage, needsdiagnosis Aug 17, 2023
@Egrodo
Copy link

Egrodo commented Aug 17, 2023

Thanks for the report! I confirmed that this is a recent regression and spent an afternoon looking into it. The fix has landed and should be deployed on Monday :)

This was an interesting bug so I figured I'd explain the fix below for anyone interested:

the issue boiled down to an async wrapper we had over the DataTransfer constructor that we were using to check osme other things before handling the DT. We were doing something like:

const data = event.clipboardData;

let text = data.getData(MIMETYPE_1);
await SomePromise();
if (text == null) {
  text = data.getData(MIMETYPE_2);
}
...

In this case MIMETYPE_1 was set when copying things from within WAWeb, and MIMETYPE_2 was text/plain, so basically any text copied from outside the app fell into this.

The issue was that by calling await we were switching into a different callstack, thus (presumably) triggering Firefox's more aggressive garbage collection to forget the contents of the data object. So when it came to calling data.getData the second time, the contents of the data object were missing, and we'd overwrite text with nullish. This is unintuitive since we didn't switch lexical scopes, but I suppose Firefox considers DataTransfer objects more expensive than other browsers?

The fix was to run both checks at the same time before calling any async code so the data would be preserved:

Aka:

const data = event.clipboardData;

let textOne = data.getData(MIMETYPE_1);
let textTwo = data.getData(MIMETYPE_2);
await SomePromise();
let text = textOne;
if (text == null) {
  text = textTwo;
}
...

@denschub
Copy link
Member

Thanks so much for the investigation and the in-flight fix, @Egrodo. This almost sounds like something going wrong inside Firefox. From what you describe, I would be surprised, too. I'll investigate our behavior here soon, maybe we can change something on our end to make this less surprising.

@denschub denschub added the status-needsinfo-denschub ping @denschub label Aug 17, 2023
@denschub denschub modified the milestones: needsdiagnosis, sitewait Aug 17, 2023
@Egrodo
Copy link

Egrodo commented Aug 17, 2023

Anytime! If it helps, Stackoverflow questions like this (datatransfer items not persisting through async calls) helped me find the solution, so seems this behavior has been around for 4 years at least. Definitely would be helpful if this were fixed, thanks for the follow-up!

@tanoalpalo
Copy link

Same issue... error 403 forbiden ... firefox do somethig
imagen

@kud

This comment was marked as outdated.

@tanoalpalo
Copy link

Thanks! what else that line does?? just in case haha

@hbrunar
Copy link

hbrunar commented Aug 22, 2023

The issue is also discussed on Superuser: https://superuser.com/questions/1804661/firefox-doesnt-allow-to-paste-into-whatsapp-web-anymore
would be great to leave an answer there, once resolved
there have been 37k views already, so many people are curious!

@gardon
Copy link

gardon commented Aug 22, 2023

It was just resolved to me, Whatsapp web prompted me to refresh to update. After that I can paste normally again.

@optimuscream
Copy link

It was just resolved to me, Whatsapp web prompted me to refresh to update. After that I can paste normally again.

Yes it works now ..yay.

@NY-Guy
Copy link

NY-Guy commented Aug 22, 2023

Still not working for me after update (to 117.0) :-( Cannot paste anything to WhatsApp web

But oddly, another problem I had - the inability to open the web site https://www.merriam-webster.com/games/quordle/#/ (which problem the folks here had been unable to reproduce) is now working!!

@schipht
Copy link

schipht commented Aug 22, 2023

seems fixed after update whatsapp web.
thank you who fix the issue after 5 days :)

C5ZYr

@ninjazan420

This comment was marked as abuse.

@Fergo
Copy link

Fergo commented Aug 22, 2023

seems fixed after update whatsapp web. thank you who fix the issue after 5 days :)

C5ZYr

The update option is still not being shown for me. Are the update deployments regional? I'm in South America.

@lando786
Copy link

Seems to be fixed with latest update, can now paste both text and images with no config changes in Firefox. Should this issue be closed?

@NY-Guy
Copy link

NY-Guy commented Aug 22, 2023

NO, do not close the issue. Some very strange behavior is happening... The latest update had fixed the issue for some, but not for others - (I'm one of the others). Even after re-boot -- I didn't know why it's working for some but still broken for others
Using version 117.0 64-bit. WhatsApp web pasting still wasn't working.
UPDATE - suddenly this morning it started working again. Same Firefox version, no re-boot. So clearly something else is going on besides just which desktop version it being used - otherwise we would see some consistent behavior. For those who are still facing the problem, clearly something is (or was) happening on the "back end"

@schipht
Copy link

schipht commented Aug 22, 2023

seems fixed after update whatsapp web. thank you who fix the issue after 5 days :)
C5ZYr

The update option is still not being shown for me. Are the update deployments regional? I'm in South America.

I had same issue. When Whatsapp Web window still open I opened another Whatsapp Web window and update available notification came.

@denschub
Copy link
Member

I'm locking this issue, as nobody seemed to care about my previous comment where I said

Please stop commenting new "me too"s. We know what the issue is, and as per this comment, WhatsApp has already built a fix and is working on deploying it. There is no need for more reports.

Let's please keep this issue low-noise so that we can figure out if there is something that needs to change in Firefox to make our behavior less surprising.

we don't need additional reports about this, and WhatsApp is rolling out a fix as stated multiple time. This isn't related to any specific Firefox version or Firefox update. It'll start working again once you've received the WhatsApp update. Please don't file another reports about paste-issues on WhatsApp - be patient until they have fully rolled out the patch.

@Egrodo if you want to continue figuring out the internals here, please email me to dschubert@mozilla.com and we'll get you into the right discussion lists so that we can have a chat about our behavior here. :)

@webcompat webcompat locked as resolved and limited conversation to collaborators Aug 22, 2023
@denschub denschub modified the milestones: sitewait, fixed Aug 22, 2023
@denschub denschub removed the status-needsinfo-denschub ping @denschub label Aug 22, 2023
@sv-calin sv-calin added the trend-clipboard OKR Label - Issues where operations with copy/paste/cut/select text are failing label Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
browser-firefox engine-gecko The browser uses the Gecko rendering engine os-win11 Issues that are reproducible only on Windows 11 priority-normal severity-critical The site or core functionality is unusable, or you would probably open another browser to use it. trend-clipboard OKR Label - Issues where operations with copy/paste/cut/select text are failing type-clipboard Issue with navigator.clipboard
Projects
None yet
Development

No branches or pull requests