Skip to content

Refactor thread information code#953

Merged
KitsuneRal merged 4 commits intodevfrom
kitsune/refactor-thread-code
Feb 6, 2026
Merged

Refactor thread information code#953
KitsuneRal merged 4 commits intodevfrom
kitsune/refactor-thread-code

Conversation

@KitsuneRal
Copy link
Copy Markdown
Member

Most important stuff is all in 5edd135 - boiling down to the room-aware ThreadInfos class and ThreadInfos::updateFrom() taking place of both Room::updateThread() and Thread::addEvent(). The thread info updating code also received some shake-down - the whole refactoring started with me stumbling over a crasher when a thread is created in an encrypted room, and then I found another couple corner cases not working correctly, hopefully covered by the reworked tests.

What used to be a Thread active class is now called ThreadInfo and it's
a dumb data structure. Next to it, there's ThreadInfos, which is a class
where all work on creating and updating thread information occurs,
consolidating (and fixing) the code that was in Room::updateThread() and
Thread::addEvent().

Since ThreadInfos cannot merely update from an event - a real room is
necessary - the test in testthread.cpp now creates that room and makes a
thread
in it. Each test function uses the same thread creation logic, put into
exchangeThreadEvents(); but observes this thread from different
viewpoints - as the thread participants (newThread) and as a separate
room member who looks at the thread in room history (historicalThread)
and in a sync (rootAlreadyThreaded). Unfortunately, rootAlreadyThreaded
cannot really test the event payload as Synapse doesn't seem to
aggregate the thread as expected; but the ThreadInfo can be tested.
testthread requires a Synapse container now, so instead of polluting the
CI script we mark the tests in CMakeLists.txt
@KitsuneRal KitsuneRal added bug/fix The library doesn't work as expected enhancement A feature or change request for the library labels Feb 2, 2026
@github-project-automation github-project-automation Bot moved this to In work in libQuotient 1 Feb 2, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 2, 2026

@KitsuneRal KitsuneRal merged commit ed05e7e into dev Feb 6, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from In work to 0.10 - Done in libQuotient 1 Feb 6, 2026
@KitsuneRal KitsuneRal deleted the kitsune/refactor-thread-code branch February 6, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug/fix The library doesn't work as expected enhancement A feature or change request for the library

Projects

Status: 0.10 - Done

Development

Successfully merging this pull request may close these issues.

2 participants