Skip to content

Commit 34943af

Browse files
committed
fix-rotate-notifs-null-stream-ordering
1 parent 37ad300 commit 34943af

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

build/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ COPY workers.patch /tmp/workers.patch
2323
RUN patch $(ls /usr/local/lib/python$PYTHON_PKG_VER/site-packages/synapse/config/workers.py) \
2424
< /tmp/workers.patch \
2525
&& rm /tmp/workers.patch
26+
COPY fix-rotate-notifs-null-stream-ordering.patch /tmp/fix-rotate-notifs-null-stream-ordering.patch
27+
RUN patch $(ls /usr/local/lib/python$PYTHON_PKG_VER/site-packages/synapse/storage/databases/main/event_push_actions.py) \
28+
< /tmp/fix-rotate-notifs-null-stream-ordering.patch \
29+
&& rm /tmp/fix-rotate-notifs-null-stream-ordering.patch
2630

2731
# stage 3 : apply e2e_room_keys.patch
2832
FROM pipwheels AS e2e_patch
@@ -40,6 +44,9 @@ RUN --mount=type=bind,from=pipwheels,source=/wheels,target=/wheels \
4044
COPY --from=workers_patch \
4145
/usr/local/lib/python${PYTHON_PKG_VER}/site-packages/synapse/config/workers.py \
4246
/usr/local/lib/python${PYTHON_PKG_VER}/site-packages/synapse/config/workers.py
47+
COPY --from=workers_patch \
48+
/usr/local/lib/python$PYTHON_PKG_VER/site-packages/synapse/storage/databases/main/event_push_actions.py \
49+
/usr/local/lib/python$PYTHON_PKG_VER/site-packages/synapse/storage/databases/main/event_push_actions.py
4350

4451
# stage 5 : base version with e2e_room_keys table optimization
4552
FROM main AS e2e
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--- a/synapse/storage/databases/main/event_push_actions.py
2+
+++ b/synapse/storage/databases/main/event_push_actions.py
3+
@@ -1464,6 +1464,12 @@
4+
if not self.hs.is_mine_id(user_id):
5+
continue
6+
7+
+ # event_stream_ordering is NULL for federated receipts where
8+
+ # the server doesn't have the event locally. No push actions
9+
+ # exist for such events, so there is nothing to clean up.
10+
+ if stream_ordering is None:
11+
+ continue
12+
+
13+
thread_clause = ""
14+
thread_args: tuple = ()
15+
if thread_id is not None:

0 commit comments

Comments
 (0)