test(#707): preserve approval boundary during session GC
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
This commit is contained in:
@@ -65,6 +65,13 @@ describe('SessionGCService', () => {
|
||||
expect(result.cleaned.valkeyKeys).toBeUndefined();
|
||||
});
|
||||
|
||||
it('collect() only scans its session namespace and cannot reach durable approvals', async () => {
|
||||
await service.collect('abc');
|
||||
|
||||
expect(mockRedis.scan).toHaveBeenCalledWith('0', 'MATCH', 'mosaic:session:abc:*', 'COUNT', 100);
|
||||
expect(mockRedis.del).not.toHaveBeenCalledWith(expect.stringContaining('command-approval'));
|
||||
});
|
||||
|
||||
it('collect() returns sessionId in result', async () => {
|
||||
const result = await service.collect('test-session-id');
|
||||
expect(result.sessionId).toBe('test-session-id');
|
||||
|
||||
Reference in New Issue
Block a user