Skip to content

Spec list carries last_activity_at for accurate room ordering - #177

Merged
udaychandra merged 1 commit into
mainfrom
feat/spec-last-activity
Jul 29, 2026
Merged

Spec list carries last_activity_at for accurate room ordering#177
udaychandra merged 1 commit into
mainfrom
feat/spec-last-activity

Conversation

@udaychandra

Copy link
Copy Markdown
Contributor

Mast's rooms sidebar orders by activity, but message traffic is invisible to updated_at and the client-side approximation (recent-events window) decays for rooms whose last message is older than the window.

  • MessageStore.latestBySpec(): one GROUP BY aggregate, spec id → newest message time
  • GlobalSpecsListResponse gains an optional decoration: each spec map carries last_activity_at = max(updated_at, latest message), computed at the response seam — no SpecRow/GlobalSpecView shape change (8 ctor sites untouched)
  • Omitted entirely when the box has no message store → version-skew-safe client fallback

TDD; mvn -Pintegration -Dsail.it.requireIncus=false clean verify green (all gates).

A room's message traffic is the one activity updated_at cannot see, and
clients were approximating it from the bounded recent-events window —
accurate ordering decayed past the window. The list response now emits
last_activity_at = max(updated_at, the room's newest message) per spec,
computed from one aggregate query and attached at the response seam so
no view record or store row changes shape. Omitted when the serving box
has no message store, so a skewed client can detect absence and fall
back.
@udaychandra
udaychandra merged commit d3ebadd into main Jul 29, 2026
3 checks passed
@udaychandra
udaychandra deleted the feat/spec-last-activity branch July 29, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant