diff options
author | 2024-09-28 20:47:46 +0000 | |
---|---|---|
committer | 2024-09-28 22:47:46 +0200 | |
commit | 095663f5ccd10a4cd04ef6ad836f37346fc748ae (patch) | |
tree | 2a0c5a6f2d958fcf88501776013485b987766701 /internal/cache | |
parent | [chore] use string formatting package agnostic way of printing request attemp... (diff) | |
download | gotosocial-095663f5ccd10a4cd04ef6ad836f37346fc748ae.tar.xz |
[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 <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/cache')
-rw-r--r-- | internal/cache/util.go | 2 | ||||
-rw-r--r-- | internal/cache/visibility.go | 12 |
2 files changed, 9 insertions, 5 deletions
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, }) } |