From 1480f22aeaac1772bb9a98c0db6e9a13ff2761e1 Mon Sep 17 00:00:00 2001 From: tobi Date: Fri, 2 May 2025 16:01:30 +0000 Subject: [bugfix/chore] Invalidate prepared statuses when account representation changes (#4107) This pull requests adds logic to invalidate prepared statuses when an account's representation changes due to an update. Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4104 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4107 Co-authored-by: tobi Co-committed-by: tobi --- internal/processing/workers/surfacetimeline.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/processing/workers/surfacetimeline.go') diff --git a/internal/processing/workers/surfacetimeline.go b/internal/processing/workers/surfacetimeline.go index 2046d1995..ebb77b6bb 100644 --- a/internal/processing/workers/surfacetimeline.go +++ b/internal/processing/workers/surfacetimeline.go @@ -826,6 +826,12 @@ func (s *Surface) removeTimelineEntriesByAccount(accountID string) { s.State.Caches.Timelines.List.RemoveByAccountIDs(accountID) } +// removeTimelineEntriesByAccount invalidates all cached timeline entries authored by account ID. +func (s *Surface) invalidateTimelineEntriesByAccount(accountID string) { + s.State.Caches.Timelines.Home.UnprepareByAccountIDs(accountID) + s.State.Caches.Timelines.List.UnprepareByAccountIDs(accountID) +} + func (s *Surface) removeRelationshipFromTimelines(ctx context.Context, timelineAccountID string, targetAccountID string) { // Remove all statuses by target account // from given account's home timeline. -- cgit v1.2.3