chatwoot / chatwoot-mobile-app

Mobile app for Chatwoot - React Native
https://www.chatwoot.com/mobile-apps
MIT License
613 stars 282 forks source link

bug: Telegram inbox: images (photo) not shown (HTTP 302 problem) #782

Open povesma opened 4 months ago

povesma commented 4 months ago

Describe the bug I'm running an on-premise Chatwoot server (3.9.0).

When an image is sent from Chatwoot to Telegram bot inbox (I suspect, it also applies to other inboxes), the image is not visible in a mobile app (Android, v. 1.10.37, also seen on iOS app). Web-server receives a request (/rails/active_storage/representations/redirect/{base64-encoded-json}--some_id/file_444.jpg), and returns HTTP 302 with a location like

/rails/active_storage/disk/{blah-blah}/file_444.jpg

To Reproduce

Send an image from the mobile app to a Telegram bot inbox. Image placeholder appears in the chat as a white rectangle, but no image is visible. On web all is good - image is visible

Expected behavior

Image is visible

Environment

Possible fixes

I think, that the issue is in handling redirect (302). I reconfigured by Nginx to intercept and handle 302 and return the actual content of 'location' instead of returning 302, and the problem gone.

linear[bot] commented 4 months ago

PR-1100 Telegram inbox: images (photo) not shown (HTTP 302 problem)