Skip to content

smp-server: group pending notifications by service in one pass - #1973

Draft
evgeny-simplex wants to merge 2 commits into
simplex-chat:masterfrom
evgeny-simplex:ep/ntf-service-grouping
Draft

evgeny-simplex wants to merge 2 commits into
simplex-chat:masterfrom
evgeny-simplex:ep/ntf-service-grouping

Conversation

@evgeny-simplex

@evgeny-simplex evgeny-simplex commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

In each notification delivery cycle, the server groups pending notifiers by the service of each notifier's queue in one pass, so the cycle cost is independent of the number of service records.

  • memory queue store (QueueStore/STM.hs): the service is read from the queue record, and the loop over all service records is removed.
  • PostgreSQL queue store (QueueStore/Postgres.hs): the notifier-to-service map is built from the same query with its two columns swapped, and the notifiers are grouped in one pass.
  • tests: a grouping test for both stores in MsgStoreTests; newTestServiceRec is moved there from StoreLogTests unchanged.

The class method, its result type and the delivery loop are unchanged. Groups without notifiers are no longer returned by the memory store, and its groups are ordered by service ID, as in the PostgreSQL store.

/Core tests/Message store tests/
/Core tests/Store log tests/
/Notifications server

@evgeny-simplex
evgeny-simplex force-pushed the ep/ntf-service-grouping branch from 625cc4d to 0dcf655 Compare October 25, 2026 14:12
@epoberezkin
epoberezkin marked this pull request as draft October 26, 2026 11:14
@evgeny-simplex
evgeny-simplex force-pushed the ep/ntf-service-grouping branch from 7e71740 to e3d06fb Compare October 26, 2026 11:39

This branch has not been deployed

No deployments
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