-
-
Notifications
You must be signed in to change notification settings - Fork 672
Fix getLatestTimeline not working when the latest event in the room is a threaded message
#2521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5f4d10d
e8dc590
9882eb6
fdeb9e0
78f8019
50b5bb1
a3457e1
cdef5cb
cd41d7e
a3ea213
b97de19
f82ea0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…s a threaded message See matrix-org/matrix-react-sdk#8354 (comment) Also have to keep in mind that we don't want to mix messages in the wrong timelines (main vs threaded timeline) - #2444 - #2454
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ node_modules | |
| /*.log | ||
| package-lock.json | ||
| .lock-wscript | ||
| .DS_Store | ||
| build/Release | ||
| coverage | ||
| lib-cov | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5288,10 +5288,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa | |
| ]; | ||
|
|
||
| if (this.supportsExperimentalThreads()) { | ||
| if (!timelineSet.canContain(event)) { | ||
| return undefined; | ||
| } | ||
|
Comment on lines
-5213
to
-5215
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @t3chguy Any hints here? |
||
|
|
||
| // Where the event is a thread reply (not a root) and running in MSC-enabled mode the Thread timeline only | ||
| // functions contiguously, so we have to jump through some hoops to get our target event in it. | ||
| // XXX: workaround for https://github.com/vector-im/element-meta/issues/150 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -691,6 +691,18 @@ export class EventTimelineSet extends TypedEventEmitter<EmittedEvents, EventTime | |
| ); | ||
| } | ||
|
|
||
| if (timeline.getTimelineSet() !== this) { | ||
| throw new Error(`EventTimelineSet.addEventToTimeline: Timeline=${timeline.toString()} does not belong " + | ||
| "in timelineSet(threadId=${this.thread?.id})`); | ||
| } | ||
|
|
||
| // Make sure events don't get mixed in timelines they shouldn't be in | ||
| // (e.g. a threaded message should not be in the main timeline). | ||
| if (!this.canContain(event)) { | ||
| logger.warn(`EventTimelineSet.addEventToTimeline: Ignoring event=${event.getId()} that does not belong in timeline=${timeline.toString()} timelineSet(threadId=${this.thread?.id})`); | ||
| return; | ||
| } | ||
|
Comment on lines
+698
to
+709
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Split out to #2848 |
||
|
|
||
| const eventId = event.getId(); | ||
| timeline.addEvent(event, { | ||
| toStartOfTimeline, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of returning
undefined, we now just ignore the event and don't add it to the giventimelineSet.Did returning
undefinedhave some other special meaning? ThegetEventTimelineusage didn't stand out to me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it has any special meaning, see #2521 (comment)