Context
GrantFox depends on Supabase, PostgreSQL, Resend, PostHog, wallet providers, and Trustless Work/Stellar. Unbounded calls or indiscriminate retries can exhaust serverless execution time, duplicate side effects, and produce confusing UI states.
Scope
- Inventory external calls and classify them as read, idempotent write, or non-idempotent write.
- Add explicit deadlines/abort signals and typed error translation at adapter boundaries.
- Implement bounded exponential backoff with jitter only where safe.
- Add circuit breaking/bulkheads for degraded dependencies and define fallback behavior.
- Propagate correlation IDs through API handlers, jobs, and dependency calls.
- Surface recoverable versus terminal failures to clients.
Acceptance criteria
Relevant areas
Escrow hooks/adapters, email service, Supabase/Prisma clients, PostHog, API route error handling.
Context
GrantFox depends on Supabase, PostgreSQL, Resend, PostHog, wallet providers, and Trustless Work/Stellar. Unbounded calls or indiscriminate retries can exhaust serverless execution time, duplicate side effects, and produce confusing UI states.
Scope
Acceptance criteria
429, and5xx.Relevant areas
Escrow hooks/adapters, email service, Supabase/Prisma clients, PostHog, API route error handling.