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 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?

hi folks,

hi folks, i'm leveraging DO for a websocket w/ hubernation support, but keen to understand how i can pass on context to my "webSocketMessage". i want to simply pass on the user id of the user into the webSocketMessage handler. when it gets hibernated, it seems to get lost. i'll drop my fairly basic code in a thread....

Cloudflare adapter is unable to export D...

FYI - this is just a heads up regarding Astro and Durable Objects It appears that the current astro/cloudflare adapter is unable to build a worker which exports classes for durable objects This means that even if you use workers assets with Astro, you still can't combine your durable object code with other Astro SSR code in one worker. I have filed https://github.com/withastro/adapters/issues/494 Repro in https://github.com/jldec/astro-do/pull/1...

not that I know of, but you can fetch

not that I know of, but you can fetch https://cloudflare.com/cdn-cgi/trace from the DO to work out where it is and return early if in HKG

Hmm is there some documentation

Hmm is there some documentation detailing this? If we can't make reliable assumptions about memory availability with > 1 DO namespace instance that seems problematic....

Websocket Server with Durable Object Client Connection

Hi, I try build a websocket server with durable object hibernation api, on the server side I think its considered done, but on the client side, how we connect to the durable object using service binding ? I'm using cloudflare pages and want to connect to the websocket server using service binding anyone have code snippet to get address...

Hello 👋 , are there any guides/examples

Hello 👋 , are there any guides/examples on how one might do an transfer migration? We have 5 DOs and we want to split 3 DOs to a separate worker that has a very simple worker bundle leading to faster startup times. I don't see much info on the docs here https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/

Hi.

Hi. I'm seeing a strange behavior of wasm in DurableObjects, especially when alarms are used. I saw this exception in logs before we were using alarms (when response was synchronous), but now it started happenning very often. The library used is automerge. After a DO gets into a "broken state", an exception is raised for any library method call in the code produced by wasm-bindgen:...
No description
Next