Conversation
Store remove-queue errors as strings instead of `error` values so JSON responses serialize correctly and clients can decode them reliably. Also record purge failures from DB list/delete, bucket parsing/client lookup, and object removal into `RemoveQueue` so operation status reflects all encountered errors.
9 tasks
BenHall-1
approved these changes
Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a guild purge fails the client logs "logarchiver purge failed" with nothing to act on, because
status.errorsis always empty.RemoveQueue.AddErrorandAddRemovedObjectlost their only callers in 4efab9e and have been dead code since; failure reasons only ever reached our own logger.Wired
AddErrorinto all five failure paths (bucket parse, S3 client lookup, object listing, object removal, database) andAddRemovedObjecton success. This also refreshesLastUpdated, which fixes the reaper force-flipping any purge running past 10 minutes totimeout.Changed
RemoveOperation.Errorsfrommap[string]errortomap[string]string. Required, not cosmetic:map[string]errormarshals every value to{}andarchiverclient.PurgeStatusdecodes intomap[string]string, so populating the map without this would have turned every failed purge into a client-side decode error. Verified:old server payload: {"errors":{"obj":{}}}
client decode: json: cannot unmarshal object into Go struct field client.errors of type string
Backward-compatible: existing clients already expect
map[string]stringand until now only ever received{}.ListObjectsfailure was logged as "non-fatal" and never setfirstErr, producingcompletewith zero deletions — a silent purge failure the caller reports as success, after which it purges the database. It now fails the operation. The error travels back over a channel sincefirstErrbelongs to the outer goroutine.Objects().DeleteByGuildran unconditionally, so a failed S3 delete still dropped the object→bucket mapping and stranded the transcripts with no record of where they live. Now only runs once the objects are actually gone.For: TicketsBot-cloud/cleanupdaemon#4
THE LOGARCHIVER NEEDS TO BE BUMPED IN THE ARCHIVERCLIENT
Type of Change
Checklist