Thread index: counts, latest, forks and dates per thread, built once and kept current #243

Closed
opened 2026-10-21 19:52:52 +00:00 by littlefox · 1 comment
Owner

Groundwork for #242 (Teams-style channels and threads), decided 2026-10-21 to be done in 0.6 so #242 is affordable on big meetings.

#242 shows things LysKOM can't answer in one call:

  • each thread's reply count ("3 411 svar");
  • its latest messages and who wrote them;
  • when it was last active (for the order of the channel list);
  • where it forks;
  • where the subject changes (split-off threads);
  • its dates (the timeline).

The protocol only gives us one text stat at a time, so this needs a thread index in kom-client.

What it holds: per thread root, in a conference:

  • reply count;
  • last activity;
  • participants;
  • the newest few text numbers;
  • fork points;
  • subject-change points;
  • a coarse date histogram.

Per text, it holds its root (the thread_root walk, cached).

How it is built:

  • From the conference's newest texts backwards (local-to-global) plus their stats, grouping each under its root. This is also how a page of #242's channel list is made: "the threads touched by the last N texts".
  • Whole giant threads are walked only when opened. That is done in the background, throttled (lyskomd penalises floods) and with what is on screen first.

How it stays current: updated from async new-text messages, not rebuilt.

Bounded: by count and bytes, like the caches of #236. Possibly kept between sessions later (IndexedDB / a file) so a 3 000-reply thread isn't walked every login. Decide when measuring.

Tests: unit tests on a synthetic tree; a devserver test on the big seeded meeting (#225): counts, latest, forks and subject splits match a full walk; an async new text updates it.

Measure (#225): calls and time for the first page of a channel with a 3 000-reply thread, cold and warm.

Groundwork for #242 (Teams-style channels and threads), decided 2026-10-21 to be done in 0.6 so #242 is affordable on big meetings. #242 shows things LysKOM can't answer in one call: - each thread's reply count ("3 411 svar"); - its latest messages and who wrote them; - when it was last active (for the order of the channel list); - where it forks; - where the subject changes (split-off threads); - its dates (the timeline). The protocol only gives us one text stat at a time, so this needs a **thread index** in `kom-client`. **What it holds:** per thread root, in a conference: - reply count; - last activity; - participants; - the newest few text numbers; - fork points; - subject-change points; - a coarse date histogram. Per text, it holds its root (the `thread_root` walk, cached). **How it is built:** - From the conference's newest texts backwards (`local-to-global`) plus their stats, grouping each under its root. This is also how a page of #242's channel list is made: "the threads touched by the last N texts". - Whole giant threads are walked only when opened. That is done in the background, throttled (lyskomd penalises floods) and with what is on screen first. **How it stays current:** updated from async new-text messages, not rebuilt. **Bounded:** by count and bytes, like the caches of #236. Possibly kept between sessions later (IndexedDB / a file) so a 3 000-reply thread isn't walked every login. Decide when measuring. **Tests:** unit tests on a synthetic tree; a devserver test on the big seeded meeting (#225): counts, latest, forks and subject splits match a full walk; an async new text updates it. **Measure (#225):** calls and time for the first page of a channel with a 3 000-reply thread, cold and warm.
Author
Owner

Merged in #272 (main #456 green). Kom::thread_info(t) gives replies, the last text and when, the newest three texts, participants, forks and texts per month for t's thread. It walks the thread once (stats only, 16 at a time), keeps the result per root (500 threads), and new-text messages keep it current with no further calls. Subject splits and grouping a channel into threads stay with #242. Verified: unit test for the counting, devserver test thread_index, clippy three ways.

Merged in #272 (main #456 green). `Kom::thread_info(t)` gives replies, the last text and when, the newest three texts, participants, forks and texts per month for t's thread. It walks the thread once (stats only, 16 at a time), keeps the result per root (500 threads), and new-text messages keep it current with no further calls. Subject splits and grouping a channel into threads stay with #242. Verified: unit test for the counting, devserver test `thread_index`, clippy three ways.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
littlefox/neokom#243
No description provided.