Skip to content
Launchr Space Journal

Engineering Analysis · Global

Cancel the preview, not the job: a Cloudflare Workers test

Client disconnects can now reach more Workers by default. Decide which work depends on the open connection and test that boundary.

By Launchr Space ·

Choose which work depends on the connection: Client disconnects, then Stop live preview, then Keep accepted job.
Illustrative workflow: choose which work depends on the connection.

A user leaves a search page while it is still loading. The old request no longer needs a result, but the upstream service may keep working unless the application signals that it can stop. Cloudflare’s November 2 announcement says client disconnection reaches request.signal by default for Workers with a compatibility date of November 17, 2026 or later. Older dates retain their existing behavior unless configured differently. The signal is available to use; it does not automatically cancel every outgoing operation.

Decide which work belongs to the open tab

Live search, a draft preview and a read-only request for a progress panel are good candidates for cancellation. A background export that the product has already accepted is different: the user may close the browser and return expecting it to finish. Treat the accepted job as independent of that connection. If your interface does not distinguish between requesting a preview and committing a job, settle that product behavior before adding cancellation everywhere.

Test with a delayed dependency you control

In a staging Worker, use a deliberately slow read-only dependency. Confirm that a normal request completes first. Then cancel a second request from the client and check that the Worker detects the disconnect and passes its signal to the outgoing fetch or another operation that supports cancellation. Instrument both sides if you need to know whether the upstream server actually stopped; an aborted fetch is not proof that a remote server rolled back work or stopped computing.

Separate disconnects from service failures

Count a client cancellation separately from an unexpected upstream error or deadline. Recheck a completed request and a durable job as controls; neither should be marked failed simply because another client disconnected. Roll out on a single preview endpoint and look for reduced work on disconnected requests without a drop in valid responses. The useful result is less work no one can see, not an error chart that looks better because it hides real failures.

Sources

Keep reading