From 095663f5ccd10a4cd04ef6ad836f37346fc748ae Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:47:46 +0000 Subject: [bugfix] visibility after implicit approval not getting invalidated (#3370) * replicate issue * update go-structr to v0.8.10 with internal linked-list fix, small tweaks to caching of interaction requests * remove debug function --------- Co-authored-by: tobi --- internal/cache/util.go | 2 -- internal/cache/visibility.go | 12 +++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'internal/cache') diff --git a/internal/cache/util.go b/internal/cache/util.go index 924869aad..fde2f9ada 100644 --- a/internal/cache/util.go +++ b/internal/cache/util.go @@ -18,7 +18,6 @@ package cache import ( - "database/sql" "errors" "time" @@ -42,7 +41,6 @@ func ignoreErrors(err error) bool { // (until invalidation). db.ErrNoEntries, db.ErrAlreadyExists, - sql.ErrNoRows, ) } diff --git a/internal/cache/visibility.go b/internal/cache/visibility.go index e280054ec..a424ca5ac 100644 --- a/internal/cache/visibility.go +++ b/internal/cache/visibility.go @@ -48,9 +48,15 @@ func (c *Caches) initVisibility() { {Fields: "RequesterID", Multiple: true}, {Fields: "Type,RequesterID,ItemID"}, }, - MaxSize: cap, - IgnoreErr: ignoreErrors, - Copy: copyF, + MaxSize: cap, + IgnoreErr: func(err error) bool { + // don't cache any errors, + // it gets a little too tricky + // otherwise with ensuring + // errors are cleared out + return true + }, + Copy: copyF, }) } -- cgit v1.2.3