Skip to content

Conversation

@bjoerge
Copy link
Member

@bjoerge bjoerge commented Nov 6, 2025

Note: This enableResume is currently only available on vX so this is not ready to be merged yet, but otherwise it's ready for review.

Description

Adds enableResume: boolean to ListenerOptions. This instructs the listen-endpoint to push down events based on the Last-Event-Id header, and adds two more listener events:

  • welcomeback – when the listener has reconnected successfully. This event is emitted immediately when listener has successfully reconnected, and any resumed mutation events will arrive after.
  • reset – signals that listener can't resume events. Consumers should respond to this event by resetting local state.

What to review

  • What apiVersion should we require for this?

Testing

Unit tests added.

@vercel
Copy link

vercel bot commented Nov 6, 2025

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
tsdocs-client Ignored Ignored Feb 9, 2026 2:41pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 88.29% 3945 / 4468
🔵 Statements 88.29% 3945 / 4468
🔵 Functions 86.02% 314 / 365
🔵 Branches 89.1% 1169 / 1312
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/types.ts 100% 100% 100% 100%
src/data/listen.ts 95.45% 87.5% 100% 95.45% 153-154, 172
Generated in workflow #4031 for commit feb154d by the Vitest Coverage Report Action

@bjoerge bjoerge force-pushed the cldx-4262/new-listener-events branch from a72baa6 to a90cf67 Compare November 6, 2025 17:40
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 6, 2025

npm i https://pkg.pr.new/sanity-io/client/@sanity/client@1154

commit: feb154d

@bjoerge bjoerge force-pushed the cldx-4262/new-listener-events branch from a90cf67 to abf3db3 Compare November 6, 2025 18:51
@bjoerge bjoerge force-pushed the cldx-4262/new-listener-events branch 2 times, most recently from d21fd60 to 353a269 Compare November 19, 2025 15:17
@bjoerge bjoerge requested review from mwain and sgulseth November 19, 2025 15:32
sgulseth
sgulseth previously approved these changes Nov 19, 2025
@bjoerge bjoerge force-pushed the cldx-4262/new-listener-events branch from c291a5a to feb154d Compare February 9, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants