From be118f6bde6d1d2c19a25264d804470a7a6f9c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villafa=C3=B1ez?= Date: Wed, 19 Aug 2026 09:29:35 +0200 Subject: [PATCH] fix: [OCISDEV-811] ignore write error after successful cache read (#12772) * fix: [OCISDEV-811] ignore write error after successful cache read * chore: add changelog entry --- .../unreleased/bugfix-ignore-write-error-after-read.md | 10 ++++++++++ services/settings/pkg/store/metadata/cache.go | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/bugfix-ignore-write-error-after-read.md diff --git a/changelog/unreleased/bugfix-ignore-write-error-after-read.md b/changelog/unreleased/bugfix-ignore-write-error-after-read.md new file mode 100644 index 00000000000..4ae94ed77db --- /dev/null +++ b/changelog/unreleased/bugfix-ignore-write-error-after-read.md @@ -0,0 +1,10 @@ +Bugfix: Ignore write error after successful read + +In the settings service, we're caching data in the NATSjs store. When reading +service information, that information is written in the cache. Previously, +failing to write that information in the cache caused an error, despite +correct information being retrieved from the service successfully. Now, if the +information isn't written in the cache, we log the failure, but return the +read information without error. + +https://github.com/owncloud/ocis/pull/12772 diff --git a/services/settings/pkg/store/metadata/cache.go b/services/settings/pkg/store/metadata/cache.go index c5fc6a4d15e..c5945ea653c 100644 --- a/services/settings/pkg/store/metadata/cache.go +++ b/services/settings/pkg/store/metadata/cache.go @@ -113,7 +113,8 @@ func (c *CachedMDC) ReadDir(ctx context.Context, id string) ([]string, error) { c.logger.Error().Err(err).Msg("ReadDir: failed to update dirs cache") } - return s, err + // return valid data regardless of cache write failure + return s, nil } // MakeDirIfNotExist invalidates the cache