Skip to content

Integration Testing & Hardening - #32

Merged
github-actions[bot] merged 1 commit into
meta/17from
claude/17-issue-15-20260410-2337
Apr 10, 2026
Merged

Integration Testing & Hardening#32
github-actions[bot] merged 1 commit into
meta/17from
claude/17-issue-15-20260410-2337

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

fixes#15

Implements Issue #15 — Integration Testing & Hardening:
**Resilience**
- `packages/server/src/lib/retry.ts`: Exponential backoff retry utility
(`withRetry`, `computeRetryDelay`) with configurable attempts, delays, and
per-error `retryable` predicate.
- `packages/server/src/lib/fanout.ts`: Extended with `deliverWithRetry` —
automatically retries 5xx/network failures; treats 4xx as non-retryable.
- `packages/server/src/lib/deduplication.ts`: Idempotent inbound message
deduplication via in-memory LRU store with per-entry TTL. Includes
platform-specific key builders (Slack, Telegram, WhatsApp, generic).
- `packages/server/src/lib/graceful-storage.ts`: `withGracefulStorage` helper
catches storage errors and returns a safe fallback; `StorageHealthMonitor`
tracks sliding-window error rate for circuit-breaking.
- `packages/channels/src/reconnect.ts`: Generic `ReconnectManager` for
WebSocket-based adapters (Slack Socket Mode, Discord, etc.) with the same
exponential-backoff pattern used by the WhatsApp `SessionManager`.
**Adapter Conformance**
- `packages/channels/src/conformance-suite.ts`: `runConformanceSuite()` factory
generates a standardised Bun test suite for any `ChannelAdapter`. Covers
interface shape, capability flags, handler registration, and lifecycle.
Handles the different method naming conventions across adapters (Slack/WA/
Discord/Telegram).
- `packages/channels/src/mocks/mock-channel-server.ts`: In-process mock servers
for Slack, Telegram, and generic HTTP webhooks. Used to simulate platform
callbacks in unit and E2E tests.
**E2E Test Scenarios (Issue #15 — all 7 scenarios)**
- `packages/core/tests/e2e/lifecycle.test.ts`: Full message lifecycle tests
exercising all seven E2E scenarios from the issue using `InMemoryStorageAdapter`
and core managers (no real HTTP or database).
**Unit Tests**
- `packages/server/tests/retry.test.ts`
- `packages/server/tests/deduplication.test.ts`
- `packages/server/tests/graceful-storage.test.ts`
- `packages/server/tests/fanout.test.ts`
- `packages/channels/tests/reconnect.test.ts`
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@github-actions
github-actionsBot merged commit 30a1ec9 into meta/17Apr 10, 2026
@claudeclaudeBot mentioned this pull request Apr 10, 2026
16 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants