-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
Fix new threads not appearing. #4009
Conversation
We try to update the thread roots when creating a thread, but a thread can take some time to be ready after being created so we were calling it too soon. Add a listener for the Update event to update the thread roots once it's ready. Fixes element-hq/element-web#26799
and also add a comment to the test
@@ -363,7 +369,7 @@ export class Thread extends ReadReceipt<ThreadEmittedEvents, ThreadEventHandlerM | |||
* to the start (and not the end) of the timeline. | |||
* @param emit - whether to emit the Update event if the thread was updated or not. | |||
*/ | |||
public async addEvent(event: MatrixEvent, toStartOfTimeline: boolean, emit = true): Promise<void> { | |||
public addEvent(event: MatrixEvent, toStartOfTimeline: boolean, emit = true): void { |
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.
This was unnecessarily async. I fixed it but that set sonarcloud off on the function complexity, so I had to pull a chunk of it out to reduce the complexity. I can pull this out to a separate PR if necessary but hopefully it's obvious enough what's going on.
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.
so I had to pull a chunk of it out to reduce the complexity.
You can just mark it as won't fix
via the Sonarcloud Web UI instead
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.
ah okay, good to know. I assumed it wouldn't let me do that with code complexity.
We try to update the thread roots when creating a thread, but a thread can take some time to be ready after being created so we were calling it too soon. Add a listener for the Update event to update the thread roots once it's ready.
Fixes element-hq/element-web#26799
Checklist
Here's what your changelog entry will look like:
🐛 Bug Fixes