Skip to content

fix(frontend): bound API reads and expose retry actions (#70) - #189

Open
isaacsamual994-lang wants to merge 1 commit into
Core-Foundry:mainfrom
isaacsamual994-lang:fix/grantfox-api-timeout-retry-70
Open

isaacsamual994-lang wants to merge 1 commit into
Core-Foundry:mainfrom
isaacsamual994-lang:fix/grantfox-api-timeout-retry-70

Conversation

@isaacsamual994-lang

@isaacsamual994-lang isaacsamual994-lang commented Oct 25, 2026 •

Copy link
Copy Markdown

Summary

Fixes the indefinitely-loading GET screens covered by #70 and adds manual retry feedback without silently re-submitting writes.

  • Add withRequestTimeout for bounded async API reads, including JSON parsing. Use a safe default of 15 seconds, configurable via NEXT_PUBLIC_API_REQUEST_TIMEOUT_MS (1–120000 milliseconds) or a per-request timeoutMs option. Document this in both .env.example templates and docs/frontend-api-timeouts.md.
  • On deadline, reject with actionable ApiRequestTimeoutError and abort the underlying fetch. On component unmount or filter/wallet changes, cancel with a distinct AbortError. A late response cannot settle the timeout wrapper even when the underlying transport ignores abort.
  • Apply this to the read-only Discover Bounties (/api/tasks) and My Submissions (/api/my-submissions) screens. Add a visible loading status and user-triggered Retry loading bounties / Retry loading history options without losing filters, pagination or connected-wallet context.
  • This is deliberately a read-only UI change; no automatic retries are added to POST or other state-changing operations.

Verification (local macOS)

  • PASS: 25/25 focused Vitest 4.1.10 tests in a lightweight isolated mirror of the exact changed request-timeout.ts, request-timeout.test.ts, BountyList.tsx, and BountyList.test.tsx files: 22 timeout/configuration/cancellation/retry tests and 3 UI markup tests. The UI test setup used real React/ReactDOM with simple stand-ins for existing design-system primitives.
  • PASS: isolated strict tsc --noEmit for the exact changed timeout utility, bounty hook, bounty list and corresponding tests, with lightweight UI stubs and the repository's actual task-workflow types.
  • PASS: TypeScript parsing of all seven changed .ts/.tsx files, including both pages, with transpileModule diagnostics (syntax check, not a substitute for full app typecheck).
  • PASS: git diff --check and clean committed working tree.
  • Not yet verified: the full frontend workspace test suite, app-wide typecheck, ESLint or production build. The dependency install did not complete in the local Mac session.
  • GitHub Actions: upstream Frontend CI and Dependency Vulnerability Scan are action_required for this fork PR, awaiting the maintainers' approval to execute. No CI result is claimed.

GrantFox / payment status

Applied under the GitHub login isaacsamual994-lang through GrantFox OSS before coding. The issue is still unassigned, the label is Maybe Rewarded, and neither reward eligibility nor payment has been confirmed. Assignment/eligibility clarification was requested in the issue application comment.

Closes #70

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.

Implement API Request Timeout Handling

1 participant