From b75424071588124c426a9820bd494d50a9d17984 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 13 Apr 2025 14:47:02 +0300 Subject: [PATCH] hicli/sync: ignore invites with no state --- pkg/hicli/sync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/hicli/sync.go b/pkg/hicli/sync.go index c1aa8e3..47615dd 100644 --- a/pkg/hicli/sync.go +++ b/pkg/hicli/sync.go @@ -274,6 +274,10 @@ func (h *HiClient) processSyncInvitedRoom(ctx context.Context, roomID id.RoomID, CreatedAt: jsontime.UnixMilliNow(), InviteState: room.State.Events, } + if len(ir.InviteState) == 0 { + zerolog.Ctx(ctx).Warn().Stringer("room_id", roomID).Msg("Got invited room with no state, ignoring") + return nil + } for _, evt := range room.State.Events { if evt.Type == event.StateMember && evt.GetStateKey() == h.Account.UserID.String() && evt.Timestamp != 0 { ir.CreatedAt = jsontime.UM(time.UnixMilli(evt.Timestamp))