RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.48k stars 10.54k forks source link

[BUG] Unable to upload images on iphone using IOS web browser client (NOT APP) - Desperate #24608

Open serviceman opened 2 years ago

serviceman commented 2 years ago

Description:

I reported this bug a while back and many versions ago, about 6 months ago, and it is still an issue, so I am reporting it again now. This issue is also happening on open.rocket.chat. With the current release of rocket chat you are unable to upload photos on IOS on the browser version of the client. I have a rather large deployment and I am desperate to get this fixed (even if I have to pay). Can someone please look in to this issue. If this issue is not planned to be fixed please be upfront and tell me so I can move on to other chat platforms, or create my own. I surely can't be the only user having this issue as it has been reported to me by every single user on an iphone mobile I have and I can also reproduce it on open.rocket.chat on every single upload attempt made.

Steps to reproduce:

  1. Enter chat channel or private room
  2. Attempt to upload an image from your phone by either taking a new photo or picking one from your photo library.
  3. Once an image is selected and you choose "done" nothing happens and the image selection closes.

Expected behavior:

For the popup to add a caption, etc to appear and for upload to succeed.

Actual behavior:

Upload does nothing, no popup or anything. It's as if the image doesn't attach to the message, or no image is detected as being selected.

Server Setup Information:

Client Setup Information

Additional context

I first reported this issue back in October 2021, nearly 6 months ago, and have not had any response about the issue. Because the issue still persists, many versions and nearly 6 months later I am reporting it again on the most current version of Rocket Chat.

Relevant logs:

ankar84 commented 2 years ago

Confirm that issue on open.rocket.chat

https://user-images.githubusercontent.com/4023037/155660317-ccb00cb6-28a5-4131-85d0-078bf1564f55.MP4

ankar84 commented 2 years ago

@dudanogueira @debdutdeb please send that issue to front end team Thank you!

serviceman commented 2 years ago

I know this has been forwarded and responded to, but us there any update on this issue? Thank you in advance.

aminmohd commented 2 years ago

Hi Team, We are also unable to upload the image on iPhone 13 pro, iOS 15.3.1 and i believe this is related to the issue reported here, Is there any update on this issue?

serviceman commented 2 years ago

This has been a known issue, first reported 9 months ago, that breaks major functionality of the program. There have ben zero actual updates on if and or when this will be fixed. I am currently looking for an alternative program to use, I'll let you know what I find @aminmohd

TedsCabin commented 2 years ago

If you choose "Request Desktop Site" in Chrome on iOS it seems to work. After more testing, by removing iPhone from the UserAgent the issue is resolved.

TedsCabin commented 2 years ago

After further investigation it may be related to this https://github.com/RocketChat/Rocket.Chat/blob/4ab08d28bc3876d83897a338d5c436b666a55baa/apps/meteor/app/ui-message/client/messageBox/messageBoxActions.js#L64-L66

When using Chrome on Desktop, I can change the useragent via chrome DevTools to Mozilla/5.0 (iPod) and when you try to do an upload, it behaves weird and you get the upload dialog twice. If you remove iPod, iPhone, or iPad from the user agent it functions normally. This may be related to this issue.

TedsCabin commented 2 years ago

Duplicate of #23483

serviceman commented 2 years ago

I can confirm that this has something to do with the user agent. If I change the user agent by faking it with a script like this, the uploads work fine. I'd really rather not have to hack the program to make this work.

From my testing, if you add this to the custom scripts for logged in users, in the admin panel, uploads will start working again.

if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { Object.defineProperty(navigator, 'userAgent', { get: function () { return 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0)'; } }); }

serviceman commented 2 years ago

I can confirm that it is still happening on 4.6.3 on iphone, with the latest IOS release. The "hack" I put above enables it to still work though.

TedsCabin commented 2 years ago

if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { Object.defineProperty(navigator, 'userAgent', { get: function () { return 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0)'; } }); }

I can confirm this resolves the issue. Thanks for the easy workaround.

serviceman commented 2 years ago

It's not really a "work around". I have no idea if faking the user agent in such a way will cause any issues. This should not be viewed as any sort of fix, but more of clue as to what the issue is.

Alex01d commented 2 years ago

The same bug in 4.7.0, 4.7.4, 4.8.1, 5.0.0-rc.1

himani-mehra commented 2 months ago

Hi @serviceman , I would love to take on this issue and contribute to the project. Could you please assign it to me if it's available? Looking forward to your response. Thanks!