Why is this happening and why is no one fixing it?
Why is this happening and why is no one fixing it?
webSocketClose isn't called when the websocket isn't closed cleanly which causes the duration to build.
this.state.acceptWebSocket()?deleteAll():webSocketClose() in my code and I haven't had any issues with duration chargesCannot use assets and tail consumers in the same Worker. Tail Workers are not yet supported for Workers with assets)))JWTs can't easily be expunged/expiredTrue, but in your initial question you were concerned about writes to KV/DO/D1. If you validated the JWT on every request, it would still only be a a one-time write, and then reads after that, and if you wanted to expire it for some reason it would be 1 extra write.
getContext() works inside a scheduled event triggered by a cron?getContext() to get the KVNamespacecrons = ["0 */1 * * *"] deployed for a long time which was working.crons = ["* * * * *"] and deployed. The dashboard UI was still saying 0 */1 * * * was active, and it was still using that pattern.crons = ["0 */1 * * *"], and now the * * * * * pattern is the one actually running, despite the dashboard UI saying 0 */1 * * * is active.

eval(). This is probably another such example.
waitUntil?waitUntil suggests it would be useful only if Worker A had to wait until Worker B was comlplete, but for me it doesn't. Not sure if that makes sense!chrome-headless-shell... the docs for puppeteer.launch() incorrectly suggest you can pass a PuppeteerLaunchOptions param, but that only works for PuppeteerNode.launch(), not PuppeteerWorkers.launch()main file. For example: @types/node installed per chance? Or is something loading webworker or other similar types? What file openes if you browse to that erroring type?res is assigned? async fetch(request: Request) {
await this.ensureMessagesInitialized();
const webSocketPair = new WebSocketPair();
const [client, server] = Object.values(webSocketPair);
this.ctx.acceptWebSocket(server);
return new Response(null, {
status: 101,
webSocket: client,
});
}async webSocketClose(
ws: WebSocket,
code: number,
reason: string,
wasClean: boolean,
) {
// cleaning up storage if you want, or remove if you prefer not to delete
await this.state.storage.deleteAll();
ws.close(code, "durable object is closing websocket");
}getContext()getContext()crons = ["0 */1 * * *"]crons = ["0 */1 * * *"]crons = ["* * * * *"]0 */1 * * *0 */1 * * ** * * * *eval()waitUntilwaitUntilchrome-headless-shellpuppeteer.launch()PuppeteerLaunchOptionsPuppeteerNode.launch()PuppeteerWorkers.launch()main@types/nodewebworkerreswrangler deploy --dry-run --outdir ./dist --minify
sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload ./dist
wrangler deploy --outdir ./dist --no-bundle ./dist/index.js// scheduled.ts
async function scheduled(evt, env, ctx) {
// Do some work
}
// index.ts
import { scheduled } from "./scheduled";
export default { scheduled };