From 05a41fe1d2f7e2b45228181eaa51592aa27145f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 3 Dec 2024 08:28:21 +0100 Subject: [PATCH] Fix purging spaces --- pkg/share/manager/jsoncs3/providercache/providercache.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/share/manager/jsoncs3/providercache/providercache.go b/pkg/share/manager/jsoncs3/providercache/providercache.go index d849d7eae6..3631b96c56 100644 --- a/pkg/share/manager/jsoncs3/providercache/providercache.go +++ b/pkg/share/manager/jsoncs3/providercache/providercache.go @@ -469,7 +469,11 @@ func (c *Cache) PurgeSpace(ctx context.Context, storageID, spaceID string) error if !ok { return nil } - spaces.Spaces.Store(spaceID, &Shares{}) + newShares := &Shares{} + if space, ok := spaces.Spaces.Load(spaceID); ok { + newShares.Etag = space.Etag // keep the etag to allow overwriting the state on the server + } + spaces.Spaces.Store(spaceID, newShares) return c.Persist(ctx, storageID, spaceID) }