updates: don't die when deleting a message we don't have in db, just log and ignore

This commit is contained in:
Adam Van Ymeren
2025-06-27 20:20:53 -07:00
parent 7a04f298d2
commit af630ecbd1
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -18,7 +18,8 @@ repos:
- "go.mau.fi/mautrix-telegram"
- "-w"
- id: go-vet-mod
- id: go-staticcheck-repo-mod
# Disabled for now until we can find a way to filter out the gotd package
# - id: go-staticcheck-repo-mod
- id: go-mod-tidy
- repo: https://github.com/beeper/pre-commit-go
+5 -1
View File
@@ -697,7 +697,11 @@ func (t *TelegramClient) onDeleteMessages(ctx context.Context, channelID int64,
return err
}
if len(parts) == 0 {
return fmt.Errorf("no parts found for message %d", messageID)
zerolog.Ctx(ctx).Debug().
Int("message_id", messageID).
Int64("channel_id", channelID).
Msg("ignoring delete of message we have no parts for")
continue
}
// TODO can deletes happen across rooms?
portalKey = parts[0].Room