Add reproduction for Persistence issue - #6868
Conversation
🦋 Changeset detectedLatest commit: 30267c1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Reproduction test for empty Redis clear — Adds a protocol-faithful mock that errors on
DELwith zero keys, verifying thatPersistence.BackingPersistence.clear()succeeds when the backing store is empty.
The mock correctly simulates a Redis server that rejects zero-arity DEL, and the test properly uses it.effect, Effect.scoped, and Layer.succeed to wire it in. This faithfully triggers the bug in layerBackingRedis.clear (which expands empty KEYS results into a zero-argument DEL).
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
| @@ -0,0 +1,24 @@ | |||
| import { it } from "@effect/vitest" | |||
There was a problem hiding this comment.
Can we please remove this test file and merge the tests into the main one?
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Guarded
DELcall on empty keys —layerBackingRedis.clearnow returnsEffect.voidwhenKEYSproduces an empty array, instead of forwarding a zero-argumentDELto Redis. - Consolidated repro test into
Redis.test.ts— The original standalone repro file was removed and the test was integrated into the main Redis test suite with anit.effectblock, using a protocol-faithfulRedis.Redis.of({...})mock. - Added
patchchangeset — Documents the fix as a consumer-facingeffectpatch.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Summary
Fix Redis-backed persistence clearing so an empty store succeeds without sending a zero-key
DELcommand.Includes regression coverage in the existing Redis persistence test suite and an
effectpatch changeset.Closes EFF-307
Covered audit issues
1.
unstable-state-p-3: Empty Redis clear sends a zero-key DELModule:
PersistenceExpected contract: clear is idempotent and must succeed when the store is empty.
Observed result: A protocol-faithful Redis mock returned a wrong-arity error for DEL with zero keys.
Regression test command: