From 29da5b35a5653ae1667400d1aeee93a360c9d7ee Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Tue, 31 Dec 2024 09:44:07 +0000 Subject: [PATCH] [bugfix] more little edit fixes (#3633) * fix slice size calculation * stop attached status edit slice getting cached --- internal/cache/db.go | 1 + internal/gtsmodel/status.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/cache/db.go b/internal/cache/db.go index dc47bc31c..7a47b811f 100644 --- a/internal/cache/db.go +++ b/internal/cache/db.go @@ -1320,6 +1320,7 @@ func (c *Caches) initStatus() { s2.Mentions = nil s2.Emojis = nil s2.CreatedWithApplication = nil + s2.Edits = nil return s2 } diff --git a/internal/gtsmodel/status.go b/internal/gtsmodel/status.go index 4c65d8a88..3a348bba4 100644 --- a/internal/gtsmodel/status.go +++ b/internal/gtsmodel/status.go @@ -281,7 +281,7 @@ func (s *Status) AllAttachmentIDs() []string { } // Get count of attachment IDs. - total += len(s.Attachments) + total += len(s.AttachmentIDs) for _, edit := range s.Edits { total += len(edit.AttachmentIDs) }