Skip to content
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

Merged
merged 4 commits into from
Jan 17, 2024
Merged

Fix new threads not appearing. #4009

merged 4 commits into from
Jan 17, 2024

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Jan 16, 2024

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

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

Here's what your changelog entry will look like:

🐛 Bug Fixes

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
@dbkr dbkr marked this pull request as ready for review January 16, 2024 18:00
@dbkr dbkr requested a review from a team as a code owner January 16, 2024 18:00
@dbkr dbkr requested review from richvdh and robintown January 16, 2024 18:00
@@ -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 {
Copy link
Member Author

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.

Copy link
Member

@t3chguy t3chguy Jan 16, 2024

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

Copy link
Member Author

@dbkr dbkr Jan 17, 2024

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.

@robintown robintown removed the request for review from richvdh January 16, 2024 18:03
@dbkr dbkr added this pull request to the merge queue Jan 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 17, 2024
@dbkr dbkr added this pull request to the merge queue Jan 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 17, 2024
@dbkr dbkr added this pull request to the merge queue Jan 17, 2024
Merged via the queue into develop with commit 81b5838 Jan 17, 2024
23 checks passed
@dbkr dbkr deleted the dbkr/update_thread_roots branch January 17, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Threads not showing in sidebar
3 participants