From 3f75c78673773a319f151accaa30e43c41b2bb08 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Thu, 11 Jun 2026 19:47:34 +0100 Subject: [PATCH] Introduce a StickyEventStreamPosition NewType --- synapse/replication/tcp/streams/_base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/synapse/replication/tcp/streams/_base.py b/synapse/replication/tcp/streams/_base.py index a73f767add..2969719597 100644 --- a/synapse/replication/tcp/streams/_base.py +++ b/synapse/replication/tcp/streams/_base.py @@ -26,6 +26,7 @@ from typing import ( Any, Awaitable, Callable, + NewType, TypeVar, ) @@ -765,6 +766,13 @@ class ThreadSubscriptionsStream(_StreamFromIdGen): return rows, rows[-1][0], len(updates) == limit +StickyEventStreamPosition = NewType("StickyEventStreamPosition", int) +""" +Integer corresponding to the stream position (`stream_id`) +of a sticky event in the `sticky_events` table. +""" + + @attr.s(slots=True, auto_attribs=True) class StickyEventsStreamRow: """Stream to inform workers about changes to sticky events."""