Skip to content

Hygiene: TTL on connections, MAX_CONNECTIONS env var, cleanup#4

Open
Valamorde wants to merge 1 commit into
refactor/phase-3-typescriptfrom
refactor/phase-4-hygiene
Open

Hygiene: TTL on connections, MAX_CONNECTIONS env var, cleanup#4
Valamorde wants to merge 1 commit into
refactor/phase-3-typescriptfrom
refactor/phase-4-hygiene

Conversation

@Valamorde
Copy link
Copy Markdown
Owner

Summary

  • Adds a ttl attribute to connection items (2-hour expiry via DynamoDB TTL) — removes the need for in-process expiry checks during message forwarding
  • Promotes MAX_CONNECTIONS = 30 to an environment variable (MAX_CONNECTIONS) with the same default, configurable per stack
  • Enables DynamoDB TTL on the abovevtt table in CDK (additive, non-destructive)
  • Removes legacy per-function package.json files (no longer needed with esbuild bundling)
  • Updates cdk.json app entry to npx ts-node infra.ts

Test plan

  • pnpm test — all smoke tests pass
  • cdk diff — TTL attribute addition on table is non-destructive; no table replacement
  • Stale connections are cleaned up automatically after 2 hours without a manual sweep

- Add DynamoDB TTL (2h) on connection items via timeToLiveAttribute in CDK and
  ttl field written in connect handler; additive change, non-destructive on deploy
- Promote MAX_CONNECTIONS from hardcoded 30 to env var (default '30') in
  messageFunc environment and read via process.env.MAX_CONNECTIONS in forward.ts
- Remove in-process 2h expiry check from forwardMessage; TTL handles cleanup
- Delete all legacy per-function app.js and package.json files (superseded by
  NodejsFunction + esbuild from Phase 3)
- Clean up stale !onconnect/app.js negation rules from .gitignore
Sign up for free to 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.

1 participant