Decompose architecture into atomic, dependency-ordered tasks
19 tasks covering core testing, Redis hardening, WebSocket client/server adapters, Worker adapter, and final review gates. Iroh adapters are tracked as a deferred placeholder blocked on the @alkdev/iroh fork. Phases: core validation → Redis hardening → review gate → WebSocket adapters → review gate → Worker adapter → review gate → final validation.
This commit is contained in:
45
tasks/004-redis-channel-prefix-and-error-handling.md
Normal file
45
tasks/004-redis-channel-prefix-and-error-handling.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
id: redis-channel-prefix-and-error-handling
|
||||
name: Add channel prefix and error handling to Redis event target
|
||||
status: pending
|
||||
depends_on: [redis-adapter-tests]
|
||||
scope: narrow
|
||||
risk: low
|
||||
impact: component
|
||||
level: implementation
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
The architecture doc for the Redis adapter lists two limitations that need to be addressed:
|
||||
|
||||
1. **No channel prefix** — raw event types as channel names risk collision in shared Redis instances. The adapter should support a configurable prefix like `createRedisEventTarget({ ..., prefix: "alk:events:" })`.
|
||||
|
||||
2. **No error handling** — connection failures, reconnection, and message parse errors are not handled. The adapter should:
|
||||
- Handle serializer parse errors gracefully (log warning, skip message)
|
||||
- Handle subscribe client disconnect gracefully (registered callbacks remain but won't fire)
|
||||
- Note that in-flight messages after unsubscribe are harmless (empty callback set = no-op)
|
||||
|
||||
These are quality-of-life improvements that make the adapter production-ready.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] `CreateRedisEventTargetArgs` accepts an optional `prefix` field (string, default `""`)
|
||||
- [ ] When `prefix` is set, channel names are prefixed: `"alk:events:call.responded:uuid-123"`
|
||||
- [ ] Both publish and subscribe use the same prefix convention
|
||||
- [ ] Malformed messages from Redis (serializer parse errors) are caught and logged, not thrown
|
||||
- [ ] Existing tests updated to cover prefix behavior
|
||||
- [ ] New tests for prefix behavior and error handling
|
||||
|
||||
## References
|
||||
|
||||
- docs/architecture/event-targets/redis.md (Limitations section)
|
||||
- src/event-target-redis.ts
|
||||
|
||||
## Notes
|
||||
|
||||
> To be filled by implementation agent
|
||||
|
||||
## Summary
|
||||
|
||||
> To be filled on completion
|
||||
Reference in New Issue
Block a user