From 238f121e10f4718ae382febb36a1ff40d61aa0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Mon, 1 Sep 2025 10:45:40 +0200 Subject: [PATCH] LastModifiedSince: return latestRV even when it hasn't changed. (#110391) Return latestRV. --- pkg/storage/unified/sql/backend.go | 2 +- pkg/storage/unified/testing/storage_backend.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/storage/unified/sql/backend.go b/pkg/storage/unified/sql/backend.go index 6a567dbb2c5..b8b14a0e972 100644 --- a/pkg/storage/unified/sql/backend.go +++ b/pkg/storage/unified/sql/backend.go @@ -662,7 +662,7 @@ func (b *backend) ListModifiedSince(ctx context.Context, key resource.Namespaced // If latest RV is the same as request RV, there's nothing to report, and we can avoid running another query. if latestRv == sinceRv { - return 0, func(yield func(*resource.ModifiedResource, error) bool) { /* nothing to return */ } + return latestRv, func(yield func(*resource.ModifiedResource, error) bool) { /* nothing to return */ } } // since results are sorted by name ASC and rv DESC, we can get away with tracking the last seen diff --git a/pkg/storage/unified/testing/storage_backend.go b/pkg/storage/unified/testing/storage_backend.go index 61b4ba260fd..d77276f88c8 100644 --- a/pkg/storage/unified/testing/storage_backend.go +++ b/pkg/storage/unified/testing/storage_backend.go @@ -538,7 +538,7 @@ func runTestIntegrationBackendListModifiedSince(t *testing.T, backend resource.S isEmpty(t, seq) latestRv2, seq := backend.ListModifiedSince(ctx, key, latestRv1) - require.GreaterOrEqual(t, latestRv1, latestRv2) + require.Equal(t, latestRv1, latestRv2) isEmpty(t, seq) })