Skip to content

fix: abort underlying EventSource request when response fails validation - #1340

Merged
rexxars merged 1 commit into
mainfrom
fix/upgrade-eventsource
Sep 22, 2026
Merged

rexxars merged 1 commit into
mainfrom
fix/upgrade-eventsource

Conversation

@rexxars

@rexxars rexxars commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Description

Upgrades eventsource and eventsource-parser to fix three issues:

  • Aborts underlying fetch request when a response fails to be validated as eventsource (might happen on API errors)
  • Stops emitting events once request is closed. Previously, if a received chunk caused a close to happen but also contained messages after what caused it, they'd be emitted
  • Parser fed empty chunk at start will not strip BOM marker (not relevant to Sanity since we don't send BOM)

Note

Medium Risk
Touches the realtime EventSource path used by listen/live; risk is limited to upstream SSE connection and parsing behavior, with no local logic changes.

Overview
Bumps eventsource from ^5.1.1 to ^5.1.2 (and eventsource-parser transitively) so live/listen SSE behavior picks up upstream fixes—no application source changes in this repo.

Consumers of realtime listening get aborted underlying fetch when a response fails EventSource validation (e.g. API error bodies), no further events after close when a chunk both closes the stream and contains trailing messages, plus a parser edge case around empty initial chunks/BOM (not relevant to Sanity’s API).

Adds a minor changeset for @sanity/client and whitelists eventsource@5.1.2 under pnpm minimumReleaseAgeExclude so the newer release can install.

Reviewed by Cursor Bugbot for commit 6c030f9. Bugbot is set up for automated code reviews on this repo. Configure here.

@rexxars
rexxars requested review from binoy14 and stipsan September 21, 2026 19:58
@vercel

vercel Bot commented Sep 21, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
tsdocs-client Ignored Ignored Sep 21, 2026 7:58pm UTC

Request Review

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​eventsource@​5.1.1 ⏵ 5.1.210010010089 -2100

View full report

@github-actions

Copy link
Copy Markdown
Contributor

📚 TypeDoc Generation Result

✅ TypeDoc generated successfully!

  • File size: 4.1M
  • Total exports: 259
  • Artifact: typedoc-acdc8a7d35ff982ceab8c4d483a22de0fd9a2aa5
  • HTML docs preview: Download artifact

The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 83.82% 1918 / 2288
🔵 Statements 83.69% 1992 / 2380
🔵 Functions 78.85% 522 / 662
🔵 Branches 83.06% 1398 / 1683
File CoverageNo changed files found.
Generated in workflow #5145 for commit 6c030f9 by the Vitest Coverage Report Action

@rexxars
rexxars marked this pull request as ready for review September 21, 2026 20:01
@rexxars
rexxars enabled auto-merge September 21, 2026 20:01
@rexxars
rexxars added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit ba3de6b Sep 22, 2026
33 of 34 checks passed
@rexxars
rexxars deleted the fix/upgrade-eventsource branch September 22, 2026 15:48
@squiggler-app squiggler-app Bot mentioned this pull request Sep 22, 2026
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.

2 participants