Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

/relations sometimes returns redacted relations #5618

Closed
bwindels opened this issue Jul 4, 2019 · 4 comments
Closed

/relations sometimes returns redacted relations #5618

bwindels opened this issue Jul 4, 2019 · 4 comments
Labels
X-Needs-Info This issue is blocked awaiting information from the reporter z-bug (Deprecated Label)

Comments

@bwindels
Copy link
Contributor

bwindels commented Jul 4, 2019

The example below has some redactions included, and some missing, in the /relations responses.
The message has 16 edits, numbered from 1 to 16, with a lot of them redacted. I suspect all of the missing events were redacted, but not 100% sure.

As you can see, over the 2 requests, there are only 5+3=8 events returned, whereas there are 16 edits.

GET /_matrix/client/unstable/rooms/!RbjQlmGUZlYnyhGpoZ%3Amatrix.org/relations/%241562233076292452qFAkd%3Amatrix.org/m.replace/m.room.message?
{
  "chunk": [
    {
      "content": {
        "body": " * edit redaction test 16",
        "m.new_content": {
          "body": "edit redaction test 16",
          "msgtype": "m.text"
        },
        "m.relates_to": {
          "event_id": "$1562233076292452qFAkd:matrix.org",
          "rel_type": "m.replace"
        },
        "msgtype": "m.text"
      },
      "event_id": "$1562240282316810sGcnC:matrix.org",
      "origin_server_ts": 1562240282012,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "age": 9403081
      },
      "user_id": "@bruno4:matrix.org",
      "age": 9403081
    },
    {
      "content": {},
      "event_id": "$1562240279316805lYnLO:matrix.org",
      "origin_server_ts": 1562240279907,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "redacted_by": "$15622403573146fPZgA:matrix.org",
        "redacted_because": {
          "type": "m.room.redaction",
          "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
          "sender": "@bruno4:matrix.org",
          "content": {},
          "redacts": "$1562240279316805lYnLO:matrix.org",
          "event_id": "$15622403573146fPZgA:matrix.org",
          "origin_server_ts": 1562240357245,
          "unsigned": {
            "age": 9327848
          },
          "user_id": "@bruno4:matrix.org",
          "age": 9327848
        },
        "age": 9405186
      },
      "user_id": "@bruno4:matrix.org",
      "age": 9405186,
      "redacted_because": {
        "type": "m.room.redaction",
        "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
        "sender": "@bruno4:matrix.org",
        "content": {},
        "redacts": "$1562240279316805lYnLO:matrix.org",
        "event_id": "$15622403573146fPZgA:matrix.org",
        "origin_server_ts": 1562240357245,
        "unsigned": {
          "age": 9327848
        },
        "user_id": "@bruno4:matrix.org",
        "age": 9327848
      }
    },
    {
      "content": {},
      "event_id": "$1562240278316801HXGmV:matrix.org",
      "origin_server_ts": 1562240278235,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "redacted_by": "$15622408203152MRcbV:matrix.org",
        "redacted_because": {
          "type": "m.room.redaction",
          "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
          "sender": "@bruno4:matrix.org",
          "content": {},
          "redacts": "$1562240278316801HXGmV:matrix.org",
          "event_id": "$15622408203152MRcbV:matrix.org",
          "origin_server_ts": 1562240820856,
          "unsigned": {
            "age": 8864237
          },
          "user_id": "@bruno4:matrix.org",
          "age": 8864237
        },
        "age": 9406858
      },
      "user_id": "@bruno4:matrix.org",
      "age": 9406858,
      "redacted_because": {
        "type": "m.room.redaction",
        "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
        "sender": "@bruno4:matrix.org",
        "content": {},
        "redacts": "$1562240278316801HXGmV:matrix.org",
        "event_id": "$15622408203152MRcbV:matrix.org",
        "origin_server_ts": 1562240820856,
        "unsigned": {
          "age": 8864237
        },
        "user_id": "@bruno4:matrix.org",
        "age": 8864237
      }
    },
    {
      "content": {},
      "event_id": "$1562240276316797SJvMh:matrix.org",
      "origin_server_ts": 1562240276421,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "redacted_by": "$15622409223157DciCb:matrix.org",
        "redacted_because": {
          "type": "m.room.redaction",
          "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
          "sender": "@bruno4:matrix.org",
          "content": {},
          "redacts": "$1562240276316797SJvMh:matrix.org",
          "event_id": "$15622409223157DciCb:matrix.org",
          "origin_server_ts": 1562240922055,
          "unsigned": {
            "age": 8763038
          },
          "user_id": "@bruno4:matrix.org",
          "age": 8763038
        },
        "age": 9408672
      },
      "user_id": "@bruno4:matrix.org",
      "age": 9408672,
      "redacted_because": {
        "type": "m.room.redaction",
        "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
        "sender": "@bruno4:matrix.org",
        "content": {},
        "redacts": "$1562240276316797SJvMh:matrix.org",
        "event_id": "$15622409223157DciCb:matrix.org",
        "origin_server_ts": 1562240922055,
        "unsigned": {
          "age": 8763038
        },
        "user_id": "@bruno4:matrix.org",
        "age": 8763038
      }
    },
    {
      "content": {
        "body": " * edit redaction test 12",
        "m.new_content": {
          "body": "edit redaction test 12",
          "msgtype": "m.text"
        },
        "m.relates_to": {
          "event_id": "$1562233076292452qFAkd:matrix.org",
          "rel_type": "m.replace"
        },
        "msgtype": "m.text"
      },
      "event_id": "$1562240273316792ZcxfK:matrix.org",
      "origin_server_ts": 1562240273827,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "age": 9411266
      },
      "user_id": "@bruno4:matrix.org",
      "age": 9411266
    }
  ],
  "next_batch": "1114-1006882126"
}
GET https://matrix.org/_matrix/client/unstable/rooms/!RbjQlmGUZlYnyhGpoZ%3Amatrix.org/relations/%241562233076292452qFAkd%3Amatrix.org/m.replace/m.room.message?from=1114-1006882126
{
  "chunk": [
    {
      "content": {
        "body": " * edit redaction test 11",
        "m.new_content": {
          "body": "edit redaction test 11",
          "msgtype": "m.text"
        },
        "m.relates_to": {
          "event_id": "$1562233076292452qFAkd:matrix.org",
          "rel_type": "m.replace"
        },
        "msgtype": "m.text"
      },
      "event_id": "$1562240271316790rKqVb:matrix.org",
      "origin_server_ts": 1562240271884,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "age": 9413483
      },
      "user_id": "@bruno4:matrix.org",
      "age": 9413483
    },
    {
      "content": {
        "body": " * edit redaction test 4",
        "m.new_content": {
          "body": "edit redaction test 4",
          "msgtype": "m.text"
        },
        "m.relates_to": {
          "event_id": "$1562233076292452qFAkd:matrix.org",
          "rel_type": "m.replace"
        },
        "msgtype": "m.text"
      },
      "event_id": "$1562233083292473unYte:matrix.org",
      "origin_server_ts": 1562233083828,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "age": 16601539
      },
      "user_id": "@bruno4:matrix.org",
      "age": 16601539
    },
    {
      "content": {
        "body": " * edit redaction test 1",
        "m.new_content": {
          "body": "edit redaction test 1",
          "msgtype": "m.text"
        },
        "m.relates_to": {
          "event_id": "$1562233076292452qFAkd:matrix.org",
          "rel_type": "m.replace"
        },
        "msgtype": "m.text"
      },
      "event_id": "$1562233078292457GOpvK:matrix.org",
      "origin_server_ts": 1562233078562,
      "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
      "sender": "@bruno4:matrix.org",
      "type": "m.room.message",
      "unsigned": {
        "age": 16606805
      },
      "user_id": "@bruno4:matrix.org",
      "age": 16606805
    }
  ],
  "prev_batch": "1114-1006882126"
}

As a counter-example, on event $1562249046349785amNpP:matrix.org in the same room, all redactions are returned.

@bwindels bwindels added z-bug (Deprecated Label) feature:aggregations labels Jul 4, 2019
@bwindels
Copy link
Contributor Author

bwindels commented Jul 5, 2019

As a counter-example, on event $1562249046349785amNpP:matrix.org in the same room, all redactions are returned.

Ok, this event now also doesn't return the redacted events anymore. I guess synapse might have a batch job to remove redacted events and that is what I'm seeing here?

@richvdh
Copy link
Member

richvdh commented Apr 12, 2022

This seems to have somewhat fallen down the cracks.

For context, MSC2675 says redacted relations should not be returned here.

Do we know if it's still reproducible?

@richvdh richvdh changed the title /relations behaves inconsistently in whether or not it returns redacted relations /relations sometimes returns redacted relations Apr 12, 2022
@richvdh richvdh added the X-Needs-Info This issue is blocked awaiting information from the reporter label Apr 12, 2022
@clokep
Copy link
Member

clokep commented Apr 12, 2022

#12121 fixed some cache invalidation issues here and added some tests.

From the report my guess would be there was some cache invalidation woes?

@richvdh
Copy link
Member

richvdh commented Jun 17, 2022

let's assume this is fixed.

@richvdh richvdh closed this as completed Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
X-Needs-Info This issue is blocked awaiting information from the reporter z-bug (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

3 participants