Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

since 2 days ago I'm getting a ton of

since 2 days ago I'm getting a ton of internal error and Network connection lost. errors when calling my durable objects. they don't have particularly high load and it happens to many different instances, not just one there's no useful error to help me fix it unfortunately...

WS debugging chat

Thats it for the error message but this is the web socket error event object: `Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …} isTrusted : ...

Amazing, @Frederik — thanks for

Amazing, @Frederik — thanks for confirming it's an issue on your end, and we're looking forward to a fix! 🙏

FlareUtils Types Bug

/// <reference types="@cloudflare/workers-types" /> and ^ this works...

@bun - okay, things are working, though

@bun - okay, things are working, though I haven't properly tested all the expires stuff and whatnot... and again, I do plan to move all this into a full proof-of-concept repo with working demo etc. Anyway, some stuff in 🧵 ....

Hey all - I'm having quite a lot of

Hey all - I'm having quite a lot of trouble with WebSockets and Durable Objects in production. I believe I've narrowed the cause down to a KV put (not transactional storage). With it disabled, it seems to work decent enough, but with it enabled, it causes the websocket message processing to hang. It also seems to be getting worse over time. This is not the case when running locally.

In this case you could also use

In this case you could also use serializedAttachment on that particular WebSocket, assuming you haven't used up all the space with other stuff

closing old websocket server instances without errors

im trying to implement a ping pong logic combined with an ip rate limiter i created a Map() like so ```js // Retrieve or initialize ipInfo for this IP...

Getting tags associated with a Hibernatable WebSocket

Also, random question but if we support this.state.getTags(webSocket) for hibernatable websockets, would y'all want it to throw an error if you give it a non-hibernatable websocket? Or would you just want it to give you an empty array?

DO in rust, using (asyn) storage

Dont know anyone who uses rust for DOs that would be able to help but on javascript you run this.state.blockConcurrencyWhile(async () => { ... })

I'm working with Cloudflare Workers and

I'm working with Cloudflare Workers and Durable Objects (DO) and have a question about handling request forwarding. Specifically, I'm trying to understand the best way to forward request configurations such as the HTTP method, headers, and other details to a DO worker. Is there a specific API or method in Cloudflare Workers for directly forwarding these request configurations to a DO? Or do I need to manually extract these details from the incoming request, create a new request object with these values, and then pass this object to the DO?...

Sure -

Sure - The Durable Object handles websocket clients for a multiplayer game using a deterministic physics engine. The physics are executed on both the clients and the server. Serializing the physics world costs up to a few KB per player. To join games, I have a lobbies table in D1 with a game_state column: 'waiting' | 'playing' | 'finished'. I need to set the game to the finished state when it's abandoned, so if the player rejoins the websocket later, it won't re-initialize the DO. ...

@omar#4289 same as, I am getting the

@omar same as, I am getting the same issue, I have explained my issue
No description

hmm never had this happen personally

hmm never had this happen personally

OK I have read through the last three

OK, I have read through the last three months of discord and searched, and am still coming up empty. I am using itty-router-openapi to serve paths. I have only been getting KV pairs and that seems to work just fine in my worker. I would like to get a Durable Object called User: ```durable_objects.bindings = [...

I cannot figure out this typing error

I cannot figure out this typing error
No description

IIRC there is no way to launch a promise

IIRC there is no way to launch a promise in a durable object (from a request) in such a way that does not block a response? For example I am trying to ship logs from a custom logger async to loki, but i don't want that to block responding to a request

Hey I think someone is attacking our DOs

Hey I think someone is attacking our DOs:

```

``` const MINUTES = 60 * 1000 export class NanoID { constructor(state, env) {...

Yeah that will be the request it came

Yeah that will be the request it came from not the DO colo. Right now it is possible to do /cdn-cgi/trace, but there has been a discussion about that being removed so it wont be possible to tell.