From 4f2aa792b33fdd5fb4b22dec813b3668d7190522 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 1 Jul 2025 16:00:04 +0200 Subject: [performance] add statusfilter cache to cache calculated status filtering results (#4303) this adds another 'filter' type cache, similar to the visibility and mute caches, to cache the results of status filtering checks. for the moment this keeps all the check calls themselves within the frontend typeconversion code, but i may move this out of the typeconverter in a future PR (also removing the ErrHideStatus means of propagating a hidden status). also tweaks some of the cache invalidation hooks to not make unnecessary calls. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4303 Co-authored-by: kim Co-committed-by: kim --- internal/processing/status/context.go | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'internal/processing/status/context.go') diff --git a/internal/processing/status/context.go b/internal/processing/status/context.go index 531dff1d6..f153b2e3a 100644 --- a/internal/processing/status/context.go +++ b/internal/processing/status/context.go @@ -275,20 +275,6 @@ func (p *Processor) ContextGet( requester *gtsmodel.Account, targetStatusID string, ) (*apimodel.ThreadContext, gtserror.WithCode) { - // Retrieve filters as they affect - // what should be shown to requester. - filters, err := p.state.DB.GetFiltersByAccountID( - ctx, // Populate filters. - requester.ID, - ) - if err != nil { - err = gtserror.Newf( - "couldn't retrieve filters for account %s: %w", - requester.ID, err, - ) - return nil, gtserror.NewErrorInternalError(err) - } - // Retrieve the full thread context. threadContext, errWithCode := p.contextGet(ctx, requester, @@ -305,7 +291,6 @@ func (p *Processor) ContextGet( requester, threadContext.ancestors, gtsmodel.FilterContextThread, - filters, ) // Convert and filter the thread context descendants @@ -313,7 +298,6 @@ func (p *Processor) ContextGet( requester, threadContext.descendants, gtsmodel.FilterContextThread, - filters, ) return &apiContext, nil -- cgit v1.2.3