Description
/api/index/donation (and likely other indexer routes) returns 502 when called immediately after waitForTransactionReceipt completes. The RPC node doesn't have the receipt available on the next call (likely load-balanced to a different node).
Steps to reproduce
- Donate to a story
- Tx confirms on-chain
- Indexer is called immediately → 502 ("Failed to fetch transaction receipt")
- Manual retry later succeeds
Terminal logs
POST /api/index/donation 502 in 643ms
POST /api/index/donation 400 in 201ms
Affected routes
src/app/api/index/donation/route.ts (line 32-34)
- Check
src/app/api/index/storyline/route.ts and src/app/api/index/plot/route.ts for same pattern
Fix
Add a retry with short delay (e.g., 2-3 attempts with 1s backoff) when getTransactionReceipt fails, before returning 502.
🤖 Generated with Claude Code
Description
/api/index/donation(and likely other indexer routes) returns 502 when called immediately afterwaitForTransactionReceiptcompletes. The RPC node doesn't have the receipt available on the next call (likely load-balanced to a different node).Steps to reproduce
Terminal logs
Affected routes
src/app/api/index/donation/route.ts(line 32-34)src/app/api/index/storyline/route.tsandsrc/app/api/index/plot/route.tsfor same patternFix
Add a retry with short delay (e.g., 2-3 attempts with 1s backoff) when
getTransactionReceiptfails, before returning 502.🤖 Generated with Claude Code