You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have code for a WebSocket client that looks like this:
letconnection=newWebSocket(EVENT_LISTENER_URL,['protocol']);connection.addEventListener('open',async(event)=>{awaitsleep(180);// <- Miniflare does not actually send the message without this lineconnection.send(JSON.stringify({type: 'REQUEST_ID'}));// this doesn't actually get sent}
From logging data coming into the Durable Object, I was able to figure out that Miniflare didn't send some of my messages in response to a WebSocket open event without a forced delay of at least 180ms.
The text was updated successfully, but these errors were encountered:
Hey! 👋 This is interesting. Miniflare queues messages if you haven't called accept yet, so should dispatch all messages it receives. Any chance you're calling accept() after addEventListener("message", (e) => { ... }) in your worker?
Any chance you're calling accept() after addEventListener...
Nope.
// Create a new WebSocket connection to the caller.const[client,server]=Object.values(newWebSocketPair());server.accept();// ...server.addEventListener('message',async(event)=>{// ...});
Hey! 👋 miniflare@2.0.0-rc.1 has just been released, including a fix for this. You can find the changelog here. Thanks for reporting this, and please let me know if you have any other issues.
I have code for a WebSocket client that looks like this:
From logging data coming into the Durable Object, I was able to figure out that Miniflare didn't send some of my messages in response to a WebSocket
open
event without a forced delay of at least 180ms.The text was updated successfully, but these errors were encountered: