From 5e2897e35cd2bea889fa37a2a857f4dcc076dafc Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 11 Jun 2023 11:18:44 +0200 Subject: [bugfix] Invalidate timeline entries for status when stats change (#1879) --- internal/timeline/timeline.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'internal/timeline/timeline.go') diff --git a/internal/timeline/timeline.go b/internal/timeline/timeline.go index b973a3905..e7c609638 100644 --- a/internal/timeline/timeline.go +++ b/internal/timeline/timeline.go @@ -78,12 +78,22 @@ type Timeline interface { INDEXING + PREPARATION FUNCTIONS */ - // IndexAndPrepareOne puts a item into the timeline at the appropriate place according to its id, and then immediately prepares it. + // IndexAndPrepareOne puts a item into the timeline at the appropriate place + // according to its id, and then immediately prepares it. // - // The returned bool indicates whether or not the item was actually inserted into the timeline. This will be false - // if the item is a boost and the original item or another boost of it already exists < boostReinsertionDepth back in the timeline. + // The returned bool indicates whether or not the item was actually inserted + // into the timeline. This will be false if the item is a boost and the original + // item, or a boost of it, already exists recently in the timeline. IndexAndPrepareOne(ctx context.Context, itemID string, boostOfID string, accountID string, boostOfAccountID string) (bool, error) + // Unprepare clears the prepared version of the given item (and any boosts + // thereof) from the timeline, but leaves the indexed version in place. + // + // This is useful for cache invalidation when the prepared version of the + // item has changed for some reason (edits, updates, etc), but the item does + // not need to be removed: it will be prepared again next time Get is called. + Unprepare(ctx context.Context, itemID string) error + /* INFO FUNCTIONS */ -- cgit v1.2.3