Summary
Hello everyone, Websoket “posted” event not contains “file_ids”
Mattermost 5.9
Steps to reproduce
headers = new Headers();
headers.append(‘Content-Type’, ‘application/json’);
headers.append(‘Authorization’, token`)
fetch(${apiUrl}/posts", {
method: ‘POST’,
headers,
body: JSON.stringify({
“channel_id”: channel_id,
“message”: “message”
“file_ids”: […some array of string]
})
Expected behavior
expected something like this (from demo.mattermost.com)
in posted.data.post:
post: “{
“id”:“4oxzetjye7bp9xpafe89uuydsa”,
“create_at”:1555514416955,
“update_at”:1555514416955,
“edit_at”:0,
“delete_at”:0,
“is_pinned”:false,
“user_id”:“er4tfd5877y9u8pxdpput5b9qy”,
“channel_id”:“9eyxmiurx78kirkaz7epg64coc”,
“root_id”:”"
,“parent_id”:"",
“original_id”:"",
“message”:"",
“type”:"",
“props”:{},
“hashtags”:"",
“file_ids[“t8d9wwcs3tdp3gmt7qz3zia8dc”],
“pending_post_id”:“er4tfd5877y9u8pxdpput5b9qy:1555514416850”}”
Observed behavior
but get
post: “{
“id”:“eqp7wne44ibdxkf41s85t4hknc”,
“create_at”:1555514666584,
“update_at”:1555514666593,
“edit_at”:0,
“delete_at”:0,
“is_pinned”:false,
“user_id”:“repsxkurspb19fubnf4osu9uyr”,
“channel_id”:“6odgcqrpybgtf8x8y1gk59pt7h”,
“root_id”:”",
“parent_id”:"",
“original_id”:"",
“message”:"",
“type”:"",
“props”:{},
“hashtags”:"",
“pending_post_id”:"",
“metadata”:{}
}"
NO FILE_IDS!
Same in fetch response, no file_ids:
channel_id: “6odgcqrpybg7879y1gk59pt7h”
create_at: 1555514666584
delete_at: 0
edit_at: 0
hashtags: “”
id: “eqp7wne44890xkf41s85t4hknc”
is_pinned: false
message: “”
metadata: {}
original_id: “”
parent_id: “”
pending_post_id: “”
props: {}
root_id: “”
type: “”
update_at: 1555514666593
user_id: “repsxkurs7899fubnf4osu9uyr”