Skip to content

[#170] Increase receipt retry backoff and add client-side delay#172

Merged
realproject7 merged 2 commits intomainfrom
task/170-increase-receipt-retry
Mar 16, 2026
Merged

[#170] Increase receipt retry backoff and add client-side delay#172
realproject7 merged 2 commits intomainfrom
task/170-increase-receipt-retry

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Server-side: getReceiptWithRetry increased to 5 attempts with 2s multiplier (2/4/6/8/10s = 30s total window vs previous 6s)
  • Client-side: Added 5s delay before indexer API calls in DonateWidget and usePublish hook to allow RPC propagation on Base Sepolia
  • Combined approach (Option C) for maximum reliability

Fixes #170

Test plan

  • tsc --noEmit — zero errors
  • next build — clean
  • vitest run — 22/22 tests pass
  • Donate on Base Sepolia → indexer succeeds instead of 502

🤖 Generated with Claude Code

- getReceiptWithRetry: 5 attempts with 2s multiplier (2/4/6/8/10s = 30s total)
  instead of 3 attempts with 1s (1/2/3s = 6s)
- Add 5s client-side delay before indexer API calls in DonateWidget
  and usePublish hook to allow RPC propagation on Base Sepolia

Fixes #170

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b APPROVE

Minimal, targeted fix:

  1. Server-side (lib/rpc.ts) — 3→5 attempts, 1s→2s multiplier. Total window 30s vs previous 6s. Reasonable for Base Sepolia's propagation delays.
  2. Client-side (DonateWidget, usePublish) — 5s delay before indexer call. Both locations updated consistently.

The combined approach gives receipts time to propagate through load-balanced nodes on both sides. No issues.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

Increasing getReceiptWithRetry() to a longer server-side window is aligned with issue #170. The problem is the additional 5-second client-side delay in usePublish, which broadens this fix to every storyline/plot publish flow even though the reported bug is specifically the donation indexer on Base Sepolia.

Findings

  • [medium] The new await new Promise((r) => setTimeout(r, 5000)) inside usePublish adds a forced 5-second delay to all publish flows (/api/index/storyline and /api/index/plot), not just the donation path that issue #170 is about. That is extra user-visible latency and scope creep for unrelated routes.
    • File: src/hooks/usePublish.ts:86
    • Suggestion: Keep the stronger server-side retry globally if desired, but scope any client-side delay to the donation flow that is actually failing, or gate it behind the specific route/environment that needs it.

Decision

Requesting changes because the server-side retry fix is reasonable, but the client-side delay currently overreaches beyond the bug described in #170 and unnecessarily slows unrelated publish operations.

Remove 5s delay from usePublish (storyline/plot creation) — the
server-side retry window (30s) is sufficient. Keep delay only in
DonateWidget where the issue was observed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up commit fixes the scope issue by keeping the 5-second client-side delay only on the donation path while leaving the stronger server-side retry window in place for all routes. The updated change now matches issue #170 without slowing unrelated publish flows.

Findings

  • [info] No remaining blocking findings after 71c66b8.
    • File: src/components/DonateWidget.tsx:91
    • Suggestion: None.

Decision

Approving because the prior scope-creep issue is resolved, the donation-specific reliability fix is preserved, and lint-and-typecheck plus local typecheck, test, and build validation pass.

@realproject7 realproject7 merged commit 3e9da81 into main Mar 16, 2026
1 check passed
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.

[QA-Bug] Donation indexer still 502 — retry backoff too short for Base Sepolia

2 participants