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 created a real-time server using

I created a real-time server using Durable Objects and WebSocket. The logs confirm that both the Worker and the DO are in the SJC data center. Pinging the Worker's domain shows a latency of 2ms, but when messages are returned via WebSocket, the latency is as high as 70ms. Is the communication latency between the Worker and the DO really that high?

I didnā€™t see this graph before. But yeah

I didnā€™t see this graph before. But yeah, you can see that for the whole 2 hours, each minute (other than a few blips) I was charged 23 GB-sec per minute, even though the requests graph shows there being no requests at all during that period (other than the initial connection requests). This was one of the durable objects I was testing during that period. I had another with the exact same usage graph.
No description

In production, when a client disconnects

In production, when a client disconnects it shows a Canceled Error even if the WebSocket is closed properly with a socket.close() from the browser when the window closes. Is there a way to prevent the errors from being thrown for normal behavior? Everything works fine and no errors are thrown locally. Everything in the Worker is already in a try/catch. Thank you! This question I asked in this thread here but I have not received a reply so maybe others will see the question. https://discord.com/channels/595317990191398933/773219443911819284/threads/1277864290296135711...

Hi, question about in memory state:

Hi, question about in memory state: - According to the docs, DO could be evicted from memory and losing its in memory state, I would like to know how often this happens. I am trying to fit an usecase of DO with websockets for board game sessions without writing to persistent storage because: 1. it's expensive at scale, 2. the state is temporary anyways....

Thank you Cloudflare. I have been using

Thank you Cloudflare. I have been using WebSockets since 2012 but you made my dreams come true this week with Hibernating WebSockets. Wowza. šŸ’Æ

Also are you using hibernation or the

Also are you using hibernation or the normal ws API?

What is the best way to log stuff using

What is the best way to log stuff using cloudflare, is it using baselime and if so are console.logs captured by baselime?

hey all, have a q regarding DO eviction

hey all, have a q regarding DO eviction. is it true that DO lives at least 30 seconds? (I understand there could be edge cases like DO redeploy, I but I mean a normal scenarios) Basically I want to store some data, which I want to live at least 30 seconds and at maximum 90 seconds. So Iā€™m thinking not to store it in the storage but to rely on eviction mechanics, to not bother with storage cleaning or thereā€™s no guarantees and DO can be evicted even after 10 seconds of inactivity?...

I understand a worker will only be alive

I understand a worker will only be alive for 30 seconds or so. However, with a durable object, specifically if there is an alarm, how long will the do be alive for? For example, in an alarm I may potentially have to perform some operation that could take up to 10 minutes to resolve....

Hey everyone, trying to understand

Hey everyone, trying to understand hibernated websocket pricing with DOs. My idea was to process something for 10ms, send a message, and do nothing but once every second. I'm wondering if that means that I will get billed for every second, or if I take less than a second to do work, there is fractional billing? Example 4 seems to indicate so, but I wanted to confirm my understanding

Hi guys i create a new worker with

Hi guys i create a new worker with durable object but i got this {"status":500,"error":"Durable Object namespace binding cannot communicate with other nodes."} no idea how to fix i have paid plan

Build a WebSocket server with WebSocket ...

Hi everyone I can't get any error messages. I am trying to get my Durable Object working with Hono. My route ```javascript...

I have the weirdest situation going

I have the weirdest situation going right now... - I got a DO created inside a mini worker wrapper which is inside a larger Pages project (which sucks for DX, but I digress). - After noticing that none of the DO features were working locally for some reason, I went on the mini worker and deployed it with wrangler deploy to the correct account. - Even after deploying it, I'm (apparently?) still not able to use the DO... and the requests are 0, despite the bindings being successful (in dev.). - After this frustration, I decided to deploy to a preview environment, but because we are forced to use the build system version 1 (which doesn't support wrangler.toml), I knew I had to manually bind the DO on the dashboard....

Once a DO is created, it does not move.

Once a DO is created, it does not move. I check where a DO is by fetching a /cdn-cgi/trace, then seeing the colo field

hello here. I have a weird behavior,

hello here. I have a weird behavior, sometimes, my worker that talks to a durable object, does not reach the durable object but the worker itself.
const response = await stub.fetch('https://durable-object/something')
return await handleResponse(response)
const response = await stub.fetch('https://durable-object/something')
return await handleResponse(response)
I could clearly debug that sometimes, the response that I get is not returned by the Durable Object but by the worker itself. Any clue?...

Just hit a problem where having Durable

Just hit a problem where having Durable Objects and Smart Placement on will make it so i can't make requests to my DO. Found many other reports of the same thing here, but there doesn't seem to be an official statament about it. Could we at least get this documented under known issues or limitations on the docs? It's really frustrating to spend hours trying to fix something that was already reported a long time ago but stays undocumented.

yea........ what a sad realization :

yea........ what a sad realization :salute_sob: DO āŒ CF Pages šŸ˜­...
No description

Hi guys has anyone managed to get

Hi guys has anyone managed to get durable objects running with next pages? First i get an error mentioning migrations. Then it requires a worker name which is usually auto generated. Any help would be awesome....

Apologies, I should have been more clear

Apologies, I should have been more clear. I have a scenario where a user establishes a WebSocket connection first, and then I need to authenticate that user. The flow I am considering is as follows: The client establishes a WebSocket connection with the server....

So I'm getting ready to publish

So I'm getting ready to publish IttyDurable (which extends DurableObject)... In order for test coverage to work (GH actions), I need to make sure the environment can see/accept DurableObject, which I currently read from cloudflare:workers, assuming a Wrangler setup. Any trick/tips on how to make sure that can be used in GH actions/test runners?...