workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

bug: remote dev session expires and doesn't refresh

Open threepointone opened this issue 3 years ago • 0 comments
trafficstars

Since we landed https://github.com/cloudflare/wrangler2/pull/1391, the session doesn't refresh on every script change. This means when the dev session created on the edge does expire, the dev session breaks, and you have to restart to get it to work again. The error looks like this: Error on remote worker: workers.api.error.expired_preview_token [code: 10049]

The fix here is to detect when this error is thrown and refresh the session.

(We risk throwing away some state here, but it's better than nothing. There's a separate conversation to have about somehow pinging this to keep it alive, but that's for later.)

threepointone avatar Jul 11 '22 10:07 threepointone