Skip to content

Conversation

@krille-chan
Copy link
Contributor

@krille-chan krille-chan commented Nov 5, 2025

This fixes the situation that an event can be
a reply and in a thread. Before we have seen reply
as an relationshipType but this does conflict with
the concept of threads, where an event can be
of relationship type "thread" but also be a reply
with being a fallback or not.

Some thoughts:

We have Event.getReplyEvent() and Event.relationshipType. And there are three different cases:

  1. Normal replies
  2. Thread events with reply fallback (is_falling_back = true)
  3. Reply in a thread (is_falling_back = false)
Expected return for Event.relationshipType:
  1. RelationshipType.reply
  2. RelationshipType.thread
  3. What should this be? Actually it is both. So maybe we should remove RelationshipType.reply and replace it with a Event.isReply

We should remove the RelationshipType.reply which is actually not a relationshiptype according to the matrix spec. Instead we should add a new getter Event.inReplyToEventId({bool includingFallback = true}) where we can also say if we want to include fallbacks or not.

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.07%. Comparing base (dceaf6c) to head (b275785).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2179      +/-   ##
==========================================
+ Coverage   57.05%   57.07%   +0.01%     
==========================================
  Files         151      151              
  Lines       19280    19279       -1     
==========================================
+ Hits        11001    11003       +2     
+ Misses       8279     8276       -3     
Files with missing lines Coverage Δ
lib/src/event.dart 87.58% <100.00%> (+0.62%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dceaf6c...b275785. Read the comment docs.

Copy link
Member

@td-famedly td-famedly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't your is_falling_back be true then? that would mean the same functionality afaik?

and Event.relationshipEventId with Event.inReplyToEventId()
for replies.

This fixes the situation that an event can be
a reply and in a thread. Before we have seen reply
as an relationshipType but this does conflict with
the concept of threads, where an event can be
of relationship type "thread" but also be a reply
with being a fallback or not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants