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

i was more confused in the wrangler

i was more confused in the wrangler config with migrations and tags but i managed to figure it out

Build Chat interface

Oh its fairly easy to build a chat interface like that with DOs, I was more asking about architectural/implementation specifics on multiple sockets, any limits I should be aware of etc

CVEs

interesting. if they don't check then disabling dynamic code is useless if you can just deploy a worker from another worker. That said, an MCP server to deploy cloudflare stuff sounds neat

https://developers.cloudflare.com/

https://developers.cloudflare.com/workers/platform/storage-options/ needs to be updated since kv DOs don't have a 50gb per account limit (with sql)

I see that the worker websocket is

I see that the worker websocket is closing the connection every roughly 4.5 mins. Whats the deal with this? I've not run across any documentation which has some information on some kind of timeout.
No description

with sveltekit i cannot (yet) directly

with sveltekit i cannot (yet) directly code a durable object in the same project as the frontend/backend worker. to use durable objects in this case tho what would you recommend? should i make a worker that acts as kind of a "internal api" or is there a way to make just the DO, and link it even if they are in two separate projects?

Whats your use case? Bit more context?

Whats your use case? Bit more context?

Hm weird no clue then havent tried any

Hm weird no clue then havent tried any of that myself yet. Have you double checked that a normal worker route will allow for >30s of cpu time?

i just realized this could be used as a

i just realized this could be used as a centralized auth server no? have an array of allowed service names (for the stub) and voila anyways i should probably add docs on better-auth for this. no more d1 just for auth...

When you do `acceptWebsocket()`, you can

When you do acceptWebsocket(), you can include a topic string Param after the socket param, then you can get only sockets associated with a topic when doing getWebSockets(topic) Why can't your client make many connections? WebSockets are relatively low overhead for the frontend when they aren't actively received data...

Im interested in using DO for my chat

Im interested in using DO for my chat app but it's not quite clear to me how to handle multiple concurrent DO connections for a frontend user. My users can be in many chats at once, maybe 20 that are all active. I can't create seperate websocket instances for each one, and if each DO represents one room/conversation, how do I let the frontend subscribe to events in any of those chats? Is there a suggested way of handling this?

Storage Ops when connecting to DO Hibernatable Websockets

Why would this code cause 2 DO read operations when a websocket client connects then immediately disconnects?
No description

Looking for thoughts on the following

Looking for thoughts on the following thought process I'm having with DOs: I have a number of users who will open a browser or similar client. They will pull a DO stub for their own user_id, connect to Websockets and listen for notifications An admin user posts a new message, which pulls a list of all subscribed user_id'ss and generates a stub for each user, pulls all open Websockets, and sends the message (a single user may have multiple clients listening for notifications at once) ...

Hey team 👋 , I am having issues with

Hey team 👋 , I am having issues with DO Error: Durable Object is overloaded. Requests queued for too long. .The document says An individual Object has a soft limit of 1,000 requests per second. is there a setting or configuration which can be set to increase this limit?

If your client is in the browser this

If your client is in the browser this shouldn't be necessary. I was talking about websocket pings (not messages).

@quan @1984 Ford Laser It was definitely

@quan @1984 Ford Laser It was definitely because I didn't send pings when not sending any messages, It's a mistake on my part 😅 I was so used to browser environment where that part is abstracted that I just forgot about it completely. I haven't tested how long the ping interval can be yet, would be nice if documented

Can I emit log messages from a Durable

Can I emit log messages from a Durable Object?

Okay this is a dumb one, I think I fixed

Okay this is a dumb one, I think I fixed it. On top of the normal message and close WS handlers, I also had a error one set up, which was supposed to remove the current connection from the list of connections, but wasn't necessarily closing the connection, such as if the client experienced an error, but not one that caused the socket to close. Somewhere, this was causing the socket to stay open or something. You can see a comparison in the screenshots
No description

Anyone else having issues with

Anyone else having issues with websockets not hibernating? Some code that was working fine a few weeks ago is now no longer hibernating the connections

Some methods on my stub are being

Some methods on my stub are being returned as never. Anyone had this before?
Next