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

Events which are annotations/edits may incorrectly get bundled aggregations applied #12566

@clokep

Description

@clokep

There's a comment that events which are annotations (ie, reactions) or replacements (ie, edits) should not have bundled aggregations included with them. This behavior was regressed in #11660 as it causes the check for the event type to be skipped when calculating edits:

# Do not bundle aggregations for an event which represents an edit or an
# annotation. It does not make sense for them to have related events.
relates_to = event.content.get("m.relates_to")
if isinstance(relates_to, (dict, frozendict)):
relation_type = relates_to.get("rel_type")
if relation_type in (RelationTypes.ANNOTATION, RelationTypes.REPLACE):
return None

Subsequently this was also made buggier for threads in #11752 for similar reasons.

(Note that the behavior about whether these events can have relations to them or not, and whether those should be bundled, isn't clearly defined.)

Noticed in #12273.

Metadata

Metadata

Assignees

Labels

S-MinorBlocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions