Skip to content

[BUG] App renders attachments differently from Web Client #2926

@aKn1ghtOut

Description

@aKn1ghtOut

Description:

While using the message object example from the Docs page :
{ "alias": "Gruggy", "avatar": "http://res.guggy.com/logo_128.png", "channel": "#general", "emoji": ":smirk:", "roomId": "Xnb2kLD2Pnhdwe3RH", "text": "Sample message", "attachments": [ { "audio_url": "http://www.w3schools.com/tags/horse.mp3", "author_icon": "https://avatars.githubusercontent.com/u/850391?v=3", "author_link": "https://rocket.chat/", "author_name": "Bradley Hilton", "collapsed": false, "color": "#ff0000", "fields": [ { "short": true, "title": "Test", "value": "Testing out something or other" }, { "short": true, "title": "Another Test", "value": "[Link](https://google.com/) something and this and that." } ], "image_url": "http://res.guggy.com/logo_128.png", "message_link": "https://google.com", "text": "Yay for gruggy!", "thumb_url": "http://res.guggy.com/logo_128.png", "title": "Attachment Example", "title_link": "https://youtube.com", "title_link_download": true, "ts": "2016-12-09T16:53:06.761Z", "video_url": "http://www.w3schools.com/tags/movie.mp4" } ] }
, the message shows differently on the web client and the app.

On Web client:
Screenshot from 2021-02-20 15-18-49

On App:
Screenshot_20210220-152344_ DEBUG _Rocket Chat_Experimental_2

The client checks for the 'type' of all the file attachments while the ReactNative app currently does not. This makes differences in presentations like this possible.

Environment Information:

  • Rocket.Chat Server Version: 3.11
  • Rocket.Chat App Version: 4.14.1
  • Device Name: Nexus 6P
  • OS Version: Android 11

Steps to reproduce:

Use the above messageObject and look at the resulting message on both the clients.

Expected behavior:

Both the clients to follow the same scheme.

Actual behavior:

The attachment is rendered as an ImageAttachment instead. The image does not load because the url in the example messageobject isn't valid anymore.

Additional context:

Fix PR ready

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions