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

    Greylock

    06/29/2021, 4:13 PM
    so now I can use durable objects right from inside my svelte app 😄
  • g

    Greylock

    06/29/2021, 4:13 PM
    Copy code
    json
    {
      "id": "dea8dfadac4a5abfc56fbc2008c5ccd320b9c713a90898ac8d4aae5ea0e4a531"
    }
  • g

    Greylock

    06/29/2021, 4:13 PM
    yep
  • g

    Greylock

    06/29/2021, 4:13 PM
    it returns the id
  • g

    Greylock

    06/29/2021, 4:22 PM
    I have a question though
  • g

    Greylock

    06/29/2021, 4:22 PM
    can I await a durables response but not directly return it to the user
  • g

    Greylock

    06/29/2021, 4:22 PM
    or does a durable have to be the last request in the chain
  • g

    Greylock

    06/29/2021, 4:47 PM
    I found out the answer to that.
  • g

    Greylock

    06/29/2021, 5:47 PM
    for some reason I get a response code 200 for every single request I make to my durable object and im not sure why
  • g

    Greylock

    06/29/2021, 5:48 PM
    and I get this response body:
  • g

    Greylock

    06/29/2021, 5:48 PM
    Copy code
    json
    {
      "locked": false
    }
  • g

    Greylock

    06/29/2021, 5:48 PM
    none of that is my code though
  • g

    Greylock

    06/29/2021, 5:53 PM
  • g

    Greylock

    06/29/2021, 5:53 PM
    my worker returns the response from the DO
  • g

    Greylock

    06/29/2021, 5:53 PM
    and it has all these functions in the headers which I thought was odd
  • g

    Greylock

    06/29/2021, 6:04 PM
    Copy code
    json
    {
      "webSocket": null,
      "url": "https://fake-host/api/chat/room/2a0d05ce01a2d616055c05d16c77ef11e785596f4bae48bce1591b1fec754b42/ws",
      "redirected": false,
      "ok": false,
      "headers": {},
      "statusText": "Bad Request",
      "status": 400,
      "bodyUsed": false,
      "body": {
        "locked": false
      }
    }
  • g

    Greylock

    06/29/2021, 6:05 PM
    theres the stringified form of the response
  • g

    Greylock

    06/29/2021, 6:05 PM
    my DO immediately returns ``{ test: true }`` with a 200, so it should not be giving me a bad request
  • g

    Greylock

    06/29/2021, 6:18 PM
    any ideas?
  • g

    Greylock

    06/29/2021, 9:23 PM
    Copy code
    {"outcome":"exception","scriptName":null,"exceptions":[{"name":"TypeError","message":"Failed to execute 'get' on 'DurableObjectNamespace': parameter 1 is not of type 'DurableObjec
  • g

    Greylock

    06/29/2021, 9:24 PM
    tried something a little different and got that
  • g

    Greylock

    06/29/2021, 10:04 PM
    turns out, its the site url I think still not sure, but I got it to 'work' in a certain context
  • g

    Greylock

    06/29/2021, 10:44 PM
    has anyone else received this `` { locked: false }`` response?
  • g

    Greylock

    06/29/2021, 10:44 PM
    the error is horribly inspecific and doesnt really help in debugging. I've spent the last 4 hours trying to figure out why it happens but I cant
  • g

    Greylock

    06/29/2021, 10:45 PM
    Copy code
    json
    {
      "webSocket": null,
      "url": "https://testurl.com",
      "redirected": false,
      "ok": true,
      "headers": {},
      "statusText": "OK",
      "status": 200,
      "bodyUsed": false,
      "body": {
        "locked": false
      }
    }
  • g

    Greylock

    06/29/2021, 10:45 PM
    just got it to spit out the same message but ``status ok``
  • g

    Greylock

    06/30/2021, 1:18 AM
    still get ``{ locked: false }``
  • d

    Deleted User

    06/30/2021, 9:25 AM
    is there a nice way to have transactions across multiple DO namespaces?
  • m

    MrHalzy

    06/30/2021, 12:36 PM
    There isn't.
  • d

    Deleted User

    06/30/2021, 1:40 PM
1...117118119...567Latest