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 Preview Comments Updated (UTC)
tsdocs-client Ignored Ignored Nov 19, 2025 4:55pm

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 88.87% 3812 / 4289
🔵 Statements 88.87% 3812 / 4289
🔵 Functions 86.19% 306 / 355
🔵 Branches 90.22% 1135 / 1258
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 #3853 for commit c291a5a 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: c291a5a

@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 from abf3db3 to 62f8b49 Compare November 18, 2025 13:01
@bjoerge bjoerge force-pushed the cldx-4262/new-listener-events branch 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
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.

4 participants