From 9620a624d793317dc640e4b6f43f41f0e7f88867 Mon Sep 17 00:00:00 2001 From: Kegan Dougal <7190048+kegsay@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:16:39 +0100 Subject: [PATCH] Comment on escaped dots --- sync2/handler2/handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sync2/handler2/handler.go b/sync2/handler2/handler.go index dd03ab4..4051248 100644 --- a/sync2/handler2/handler.go +++ b/sync2/handler2/handler.go @@ -274,6 +274,7 @@ func (h *Handler) Accumulate(ctx context.Context, userID, deviceID, roomID strin for i := range timeline.Events { // Delete MSC4115 field as it isn't accurate when we reuse the same event for >1 user timeline.Events[i], _ = sjson.DeleteBytes(timeline.Events[i], "unsigned.membership") + // escape .'s in the key name timeline.Events[i], _ = sjson.DeleteBytes(timeline.Events[i], `unsigned.io\.element\.msc4115\.membership`) parsed := gjson.ParseBytes(timeline.Events[i]) eventID := parsed.Get("event_id").Str @@ -377,6 +378,7 @@ func (h *Handler) Accumulate(ctx context.Context, userID, deviceID, roomID strin func (h *Handler) Initialise(ctx context.Context, roomID string, state []json.RawMessage) error { for i := range state { // Delete MSC4115 field as it isn't accurate when we reuse the same event for >1 user state[i], _ = sjson.DeleteBytes(state[i], "unsigned.membership") + // escape .'s in the key name state[i], _ = sjson.DeleteBytes(state[i], `unsigned.io\.element\.msc4115\.membership`) } res, err := h.Store.Initialise(roomID, state)