-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Thread bundled relationships can return a split-brained latest_event #12270
Description
Description
The latest_event returned in an m.thread
bundled relationship can be split-brained if it was edited, the content got updated but the m.replace
relation is not signalled in any way, which means clients now have to manually fetch the relations on the latest_event to check whether it was edited or not.
/event/
call on the thread root await mxMatrixClientPeg.matrixClient.fetchRoomEvent("!cCpRBTFuXwPmOCUFRL:matrix.org", "$2fQ-tX_N6eXHllDPHN3gYD_2ghfbZkGfjvjQdUqxtFQ")
{
"content": {
"body": "root",
"msgtype": "m.text",
"org.matrix.msc1767.text": "root"
},
"origin_server_ts": 1647960269875,
"room_id": "!cCpRBTFuXwPmOCUFRL:matrix.org",
"sender": "@webdevguru_test31:matrix.org",
"type": "m.room.message",
"unsigned": {
"age": 66278821,
"m.relations": {
"m.thread": {
"latest_event": {
"content": {
"body": "testfoobar",
"format": "org.matrix.custom.html",
"formatted_body": "testfoobar",
"msgtype": "m.text",
"org.matrix.msc1767.message": [
{
"body": "testfoobar",
"mimetype": "text/plain"
},
{
"body": "testfoobar",
"mimetype": "text/html"
}
],
"m.relates_to": {
"event_id": "$2fQ-tX_N6eXHllDPHN3gYD_2ghfbZkGfjvjQdUqxtFQ",
"is_falling_back": true,
"m.in_reply_to": {
"event_id": "$6WWJ7Hga3ZtlTehlThl-v2_doVAFs5EaqgCoffLM9gc"
},
"rel_type": "m.thread"
}
},
"origin_server_ts": 1648024628463,
"room_id": "!cCpRBTFuXwPmOCUFRL:matrix.org",
"sender": "@webdevguru_test31:matrix.org",
"type": "m.room.message",
"unsigned": {
"age": 1920233
},
"event_id": "$e8ENHc50vigxQU3NgeZ6I5A68dL1IGqouonJb500jpk",
"user_id": "@webdevguru_test31:matrix.org",
"age": 1920233
},
"count": 7,
"current_user_participated": true
}
}
},
"event_id": "$2fQ-tX_N6eXHllDPHN3gYD_2ghfbZkGfjvjQdUqxtFQ",
"user_id": "@webdevguru_test31:matrix.org",
"age": 66278821
}
/event/
call on the latest event in the thread await mxMatrixClientPeg.matrixClient.fetchRoomEvent("!cCpRBTFuXwPmOCUFRL:matrix.org", "$e8ENHc50vigxQU3NgeZ6I5A68dL1IGqouonJb500jpk")
{
"content": {
"body": "testfoobar",
"format": "org.matrix.custom.html",
"formatted_body": "testfoobar",
"msgtype": "m.text",
"org.matrix.msc1767.message": [
{
"body": "testfoobar",
"mimetype": "text/plain"
},
{
"body": "testfoobar",
"mimetype": "text/html"
}
],
"m.relates_to": {
"event_id": "$2fQ-tX_N6eXHllDPHN3gYD_2ghfbZkGfjvjQdUqxtFQ",
"is_falling_back": true,
"m.in_reply_to": {
"event_id": "$6WWJ7Hga3ZtlTehlThl-v2_doVAFs5EaqgCoffLM9gc"
},
"rel_type": "m.thread"
}
},
"origin_server_ts": 1648024628463,
"room_id": "!cCpRBTFuXwPmOCUFRL:matrix.org",
"sender": "@webdevguru_test31:matrix.org",
"type": "m.room.message",
"unsigned": {
"age": 1940276,
"m.relations": {
"m.replace": {
"event_id": "$8fzcKK9FohMXMGhvGM13dYoLM1S6Ekgw8Oz2ojW2dl8",
"origin_server_ts": 1648025699050,
"sender": "@webdevguru_test31:matrix.org"
}
}
},
"event_id": "$e8ENHc50vigxQU3NgeZ6I5A68dL1IGqouonJb500jpk",
"user_id": "@webdevguru_test31:matrix.org",
"age": 1940276
}
Observe the event ID and content are the same, but the latter includes the m.replace
relation which should be sanely returned in the first request also.
Steps to reproduce
- Create a thread with root $root
- Reply to thread $root with event $event (content A)
- Edit event $event with event $edit (content B)
- Ask the server for $root via /event/ API and receive latest_event $event with content B and no details about m.replace or $edit
I would have expected latest_event to either be entirely unedited or edited with the relation.
Version information
matrix.org