https://discord.cloudflare.com logo
Join Discord
Powered by
# durable-objects
  • g

    Greylock

    06/30/2021, 2:13 PM
    any ideas about a websocket error 1006 when using the chat demo?
  • g

    Greylock

    06/30/2021, 2:16 PM
  • g

    Greylock

    06/30/2021, 2:16 PM
    its doing the TLS handshake and I think thats about it
  • g

    Greylock

    06/30/2021, 2:18 PM
    oh. it had a response body but I didnt even see it
  • g

    Greylock

    06/30/2021, 3:18 PM
    https://github.com/securityheaders/security-headers-cloudflare-worker/issues/8
  • g

    Greylock

    06/30/2021, 3:18 PM
    can anyone comment on this?
  • g

    Greylock

    06/30/2021, 3:18 PM
    my issue is related, I get the same error
  • g

    Greylock

    06/30/2021, 3:34 PM
    oh
  • g

    Greylock

    06/30/2021, 3:34 PM
    that might be this library specifically
  • g

    Greylock

    06/30/2021, 4:22 PM
    idk, but I should be allowed to return ``101`` from a worker, but it doesn't let me.
  • j

    James

    06/30/2021, 5:50 PM
    A 101 should work fine as long as you also attach a
    webSocket
    . Do you have another use-case for 1xx status codes?
  • g

    Greylock

    06/30/2021, 5:54 PM
    No I was attaching a websocket
  • g

    Greylock

    06/30/2021, 5:54 PM
    But I think I figured it out
  • j

    James

    06/30/2021, 6:10 PM
    What was the issue if you don't mind sharing? It may help others who run into it in future 🙂
  • g

    Greylock

    06/30/2021, 6:12 PM
    well I was passing the request into a sveltekit route to have sveltekit handle it and then return the result (so that all my route handling could be done within sveltekit)
  • g

    Greylock

    06/30/2021, 6:13 PM
    but sveltekit I guess does some kind of stringifying/parsing of the returned value so it was breaking the response object.
  • g

    Greylock

    06/30/2021, 6:13 PM
    it was not an instanceof ``Response`` when it reached the adapter
  • g

    Greylock

    06/30/2021, 6:13 PM
    so instead I just wrote a route directly in the adapter that would intercept specifically websocket requests and deal with them accordingly.
  • g

    Greylock

    06/30/2021, 8:42 PM
    also a quick question
  • g

    Greylock

    06/30/2021, 8:42 PM
    if I use SHA512 to create IDs (hash based on some input), will it "take longer" like it says it does for non-unique IDs
  • k

    kenton

    07/01/2021, 2:41 AM
    You would have to pass the SHA512 hash into
    idFromName()
    to get a valid ID. It will have the same performance characteristics
    idFromName()
    normally has -- so yes, it'll be slower on initial creation than
    newUniqueId()
    .
  • g

    Greylock

    07/01/2021, 2:47 AM
    gotcha
  • g

    Greylock

    07/01/2021, 2:58 AM
    one other question that I couldn't see on the docs, is there presently a way to delete a durable object by its ID?
  • g

    Greylock

    07/01/2021, 2:58 AM
    I assume its just ``.delete(id)`` on the namespace, but the documentation didnt mention such a method
  • w

    Wallacy

    07/01/2021, 2:59 AM
    I think there’s no way to delete a DO yet….
  • w

    Wallacy

    07/01/2021, 3:00 AM
    If you delete the class probably all instances will be deleted, but is just my speculation on that matter.
  • g

    Greylock

    07/01/2021, 3:01 AM
    I am asking about deleting only one instance, not the entire class
  • w

    Wallacy

    07/01/2021, 3:02 AM
    Yes I know, I was just saying…. For one instance there’s no way as far I know.
  • w

    Wallacy

    07/01/2021, 3:04 AM
    Anyway, someone’s tested the increase latency of a DO call? Here’s is almost 120ms… probably there’s no COLO capable of a DO nearby.
  • g

    Greylock

    07/01/2021, 3:04 AM
    my DO call is pretty fast
1...118119120...567Latest