Commit 7493b86
fix(events): address all audit findings — security, prod-readiness, tests, docs
HIGH fixes:
- Change changeset bump levels from patch to minor (new feature)
- EventLogWriter: use logger.error instead of logger.warn for ClickHouse failures
- Log warning when InMemory rate limiter used in production (no RATE_LIMIT_REDIS_HOST)
- Fix sendEmail naming collision in SKILL.md docs
MEDIUM fixes:
- Document consumerRateLimit, metrics endpoint, and DLQ config in events.md
- Add z.enum() validation on DLQ status query param (was unvalidated cast)
- Add limit param validation (Math.max/min) on DLQ list route
- Add fail-open try/catch around rate limiter checks (Redis down → allow publish)
- Add defensive safety comment on ClickHouse interval interpolation in stats route
Tests added:
- DLQ retry: nonexistent ID, already-discarded, retryAll empty
- SchemaRegistry DB: registerSchema, upsert, getSchema latest/versioned/null, listSchemas
- PublishEvent: payload size limit (512KB → 413), per-subscriber rate limit skipping
LOW fixes:
- Remove dead EventPatternSource type from core
- Make CleanupStaleSubscriptionsService extend BaseService
- Drop redundant 2-col EventSubscription index (3-col supersedes it)
- Parallelize fan-out with Promise.allSettled for better throughput
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6d5533b commit 7493b86
File tree
22 files changed
+558
-111
lines changed- .changeset
- .claude/skills/trigger-dev-tasks
- apps/webapp
- app
- routes
- v3/services/events
- test/engine
- internal-packages/database/prisma/migrations/20260305000000_drop_redundant_event_subscription_idx
- packages/core/src/v3/types
- rules/4.4.0
22 files changed
+558
-111
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
0 commit comments