mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
6adca3617e
Adds proxy configuration for Slack connections that previously bypassed
`webClientOptions.agent`. Socket Mode now uses that agent for HTTP and
WebSocket connections, and new `fetch` and `fileTransport` options cover
response URLs, webhook forwarding, and attachment downloads.
```ts
createSlackAdapter({
webClientOptions: { agent },
fetch: proxyFetch,
fileTransport,
});
```
Includes a setup example and guidance on the destination restrictions
custom download transports need to enforce.
Closes #596
---------
Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
Integration Tests
Integration tests for the Chat SDK that verify real-world webhook payloads are handled correctly.
Test Categories
- Unit tests (
slack.test.ts,teams.test.ts,gchat.test.ts) - Test adapter functionality with mock payloads - Replay tests (
replay*.test.ts) - Replay actual production webhook recordings - Emulator tests (
src/emulator/<adapter>/*.test.ts) - Drive the SDK against an in-process Emulate.dev server, one per supported adapter (@emulators/slack,@emulators/github). Assertions read the emulator's stateful store (messages, comments, reactions, installations) instead of mock call records. Each adapter is wired in via itsapiUrlconfig. Inbound deliveries: the Slack flow re-signsevent_callbackpayloads withx-slack-signaturevia a small in-test forwarder before handing them tochat.webhooks.slack(...), while the GitHub flow is a near-passthrough because the emulator'sWebhookDispatcheralready signs withX-Hub-Signature-256exactly as the adapter expects. Helpers live insrc/emulator/slack/utils.tsandsrc/emulator/github/utils.ts.
Replay Tests
Replay tests use recorded webhook payloads from production to verify the SDK handles real interactions correctly.
See fixtures/replay/README.md for:
- How to record new fixtures
- Fixture format documentation
- SHA-based recording workflow
- Platform-specific webhook formats
Running Tests
# Run all integration tests
pnpm --filter @chat-adapter/integration-tests test
# Run with watch mode
pnpm --filter @chat-adapter/integration-tests test:watch