Skip to content

Harden server fetch JSON parsing#1237

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/OUT-3750-automated-issue-triage-0f99
Draft

Harden server fetch JSON parsing#1237
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/OUT-3750-automated-issue-triage-0f99

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 18, 2026

Changes

  • Added contextual JSON parsing/error handling to fetchWithErrorHandler, including URL/body token redaction and response body previews for non-JSON responses.
  • Routed homepage, client page, async fetchers, configure, detail, and template server-side app API fetches through the shared helper.
  • Added focused tests for successful JSON parsing, non-JSON success responses, and non-OK non-JSON responses.

Testing Criteria

  • yarn test src/app/_fetchers/fetchWithErrorHandler.test.ts --runInBand
  • yarn lint:check (passes with existing warnings)
  • yarn tsc --noEmit (blocked by existing SVG module declaration errors in src/icons/index.ts, unrelated to this change)

Notes

  • Linear: OUT-3750
  • Sentry: TASKS-88

Impact & Surface Area of Change

  • Server-side data fetches for task board initial render and related pages now retry through the shared helper and emit actionable, redacted errors if an internal API returns non-JSON text/HTML instead of JSON.
  • The underlying upstream/internal API failure will still surface, but future Sentry events should identify the endpoint/status/body preview instead of only SyntaxError: Unexpected token 'A' from Undici JSON parsing.
Open in Web View Automation 

cursoragent and others added 3 commits May 18, 2026 17:14
Co-authored-by: Neil Raina <makeitraina@users.noreply.github.com>
Co-authored-by: Neil Raina <makeitraina@users.noreply.github.com>
Co-authored-by: Neil Raina <makeitraina@users.noreply.github.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tasks-app Ready Ready Preview, Comment May 18, 2026 5:17pm

Request Review

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 18, 2026

OUT-3750

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