From 89f7e9e71183e010429aa16573b4561af2c9216d Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 30 Jul 2026 10:54:51 +0300 Subject: [PATCH] fix(storage): repair the retention test build after GetRecentSessions gained a status filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Semantic merge conflict, not a logic bug: #928 added sessions_retention_test.go calling GetRecentSessions(limit) while #930 added a status parameter for the tray glance's client filtering. Both PRs were green independently and broke main only once combined, because branch protection does not require a PR to be up to date with main before merging. Pass "" — the documented no-filter value — at the four call sites. The retention tests want every surviving record, so unfiltered is the correct argument, not merely the compiling one. --- internal/storage/sessions_retention_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/storage/sessions_retention_test.go b/internal/storage/sessions_retention_test.go index 6fd42201..85782df0 100644 --- a/internal/storage/sessions_retention_test.go +++ b/internal/storage/sessions_retention_test.go @@ -213,7 +213,7 @@ func TestEnforceSessionRetention_KeepsLiveSessionWhenClosedOnesCouldGo(t *testin "a connected client's record must not be evicted while closed records remain") assert.Equal(t, "active", got.Status) - sessions, total, err := m.GetRecentSessions(sessionRetentionLimit) + sessions, total, err := m.GetRecentSessions(sessionRetentionLimit, "") require.NoError(t, err) assert.LessOrEqual(t, total, sessionRetentionLimit, "the hard cap must still hold") assert.True(t, containsSessionID(sessions, "live-session"), @@ -249,7 +249,7 @@ func TestEnforceSessionRetention_KeepsIdleLiveSessionOverFresherClosedOnes(t *te "however recently those closed sessions were active") assert.Equal(t, "active", got.Status) - sessions, total, err := m.GetRecentSessions(sessionRetentionLimit) + sessions, total, err := m.GetRecentSessions(sessionRetentionLimit, "") require.NoError(t, err) assert.Equal(t, sessionRetentionLimit, total) assert.True(t, containsSessionID(sessions, "idle-live-session"), @@ -275,7 +275,7 @@ func TestEnforceSessionRetention_CapHoldsWhenEverySessionIsActive(t *testing.T) require.NoError(t, m.CreateSession(s)) } - sessions, total, err := m.GetRecentSessions(sessionRetentionLimit + 100) + sessions, total, err := m.GetRecentSessions(sessionRetentionLimit+100, "") require.NoError(t, err) assert.Equal(t, sessionRetentionLimit, total, "an all-active bucket must still be capped — otherwise abandoned sessions grow without bound") @@ -297,7 +297,7 @@ func TestEnforceSessionRetention_EvictsOldestClosedFirst(t *testing.T) { require.NoError(t, m.CreateSession(s)) } - sessions, total, err := m.GetRecentSessions(sessionRetentionLimit + 50) + sessions, total, err := m.GetRecentSessions(sessionRetentionLimit+50, "") require.NoError(t, err) assert.Equal(t, sessionRetentionLimit, total)