From 429645c3a9c19dd8214b63cd3c8979f5e48af159 Mon Sep 17 00:00:00 2001 From: Aine Date: Tue, 22 Aug 2023 14:41:52 +0300 Subject: [PATCH] try to handle unknown parent events --- bot/email.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/email.go b/bot/email.go index 19536b3..411a389 100644 --- a/bot/email.go +++ b/bot/email.go @@ -120,7 +120,10 @@ func (b *Bot) IncomingEmail(ctx context.Context, email *email.Email) error { content := email.Content(threadID, cfg.ContentOptions()) eventID, serr := b.lp.Send(roomID, content) if serr != nil { - return utils.UnwrapError(serr) + if !strings.Contains(serr.Error(), "M_UNKNOWN") { // if it's not an unknown event event error + return utils.UnwrapError(serr) + } + threadID = "" // unknown event edge case - remove existing thread ID to avoid complications } if threadID == "" { threadID = eventID