LastModifiedSince: return latestRV even when it hasn't changed. (#110391)

Return latestRV.
This commit is contained in:
Peter Štibraný
2025-09-01 08:45:40 +00:00
committed by GitHub
parent a0280d701b
commit 238f121e10
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
@@ -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)
})