Skip to content
This repository has been 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

Closed
clokep opened this issue Apr 27, 2022 · 1 comment · Fixed by #12633
Closed

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

clokep opened this issue Apr 27, 2022 · 1 comment · Fixed by #12633
Assignees
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@clokep
Copy link
Member

clokep commented Apr 27, 2022

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.

@clokep clokep added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Apr 27, 2022
@clokep clokep self-assigned this Apr 27, 2022
@clokep
Copy link
Member Author

clokep commented Apr 27, 2022

I have a fix on this which depends on #12273.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant