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

    ckoeninger

    05/25/2023, 8:31 PM
    nope
  • c

    ckoeninger

    05/25/2023, 8:33 PM
    fair amount of internal discussion on that, but in the end decided it was cleaner to serialize immediately when putting so any errors were available then (rather than at hibernation time), and avoid the question of what happens when you mutate an object that's referenced by the attachment
  • c

    ckoeninger

    05/25/2023, 8:36 PM
    i'm assuming by updating state you meant e.g. https://github.com/cloudflare/workers-chat-demo/blob/hibernation/src/chat.mjs#L303 but if you're talking about something unrelated to the hibernation api let me know
  • k

    Koci

    05/25/2023, 8:39 PM
    Can we test the new hibernation api locally? I think it broke when I tried it with wrangler dev earlier
  • d

    DanTheGoodman

    05/25/2023, 9:26 PM
    Hey trying to use the new hibernation beta with wrangler 3.0.1 but I don't see the new types on the DurableObjectState, do I need a different version?
  • d

    DanTheGoodman

    05/25/2023, 9:26 PM
    https://developers.cloudflare.com/workers/runtime-apis/durable-objects/#state-methods-for-websockets these specifically
  • d

    DanTheGoodman

    05/25/2023, 9:30 PM
    I've just changed all my TS code over but got lots of red right now XD
  • k

    kian

    05/25/2023, 9:32 PM

    https://cdn.discordapp.com/attachments/773219443911819284/1111406396521586809/image.png▾

  • k

    kian

    05/25/2023, 9:32 PM
    Seems to be there
  • d

    DanTheGoodman

    05/25/2023, 9:33 PM
    I have this
    Copy code
    declare interface DurableObjectState {
      waitUntil(promise: Promise<any>): void;
      readonly id: DurableObjectId;
      readonly storage: DurableObjectStorage;
      blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
    }
  • d

    DanTheGoodman

    05/25/2023, 9:33 PM
    let me snipe node modules
  • d

    DanTheGoodman

    05/25/2023, 9:33 PM
    nope still not there
  • k

    kian

    05/25/2023, 9:33 PM
    Have you updated workers-types?
  • d

    DanTheGoodman

    05/25/2023, 9:33 PM
    oooh no
  • d

    DanTheGoodman

    05/25/2023, 9:34 PM
    LMAO obviously that's the right package to update
  • d

    DanTheGoodman

    05/25/2023, 9:40 PM
    It doesn't seem like this code is running on websocket close or error
    Copy code
    async webSocketClose(ws: WebSocket, code: number, reason: string, wasClean: boolean) {
        console.log(`websocket closed code=${code} wasClean=${wasClean} reason='${reason}'`)
      }
      async webSocketError(ws: WebSocket, error: any) {
        console.log(`websocket error: ${error.message} --- ${JSON.stringify(error)}`)
      }
  • d

    DanTheGoodman

    05/25/2023, 9:41 PM
    tried closing the tab and didn't get either of those
  • d

    DanTheGoodman

    05/25/2023, 9:49 PM
    (plz ping if someone responds!)
  • k

    Koci

    05/25/2023, 10:08 PM
    seems to work fine

    https://cdn.discordapp.com/attachments/773219443911819284/1111415494021500989/Screenshot_2023-05-26_at_0.03.24.png▾

  • d

    DanTheGoodman

    05/25/2023, 10:09 PM
    super weird, I have mine deployed
  • k

    Koci

    05/25/2023, 10:10 PM
    I don't think you can get the logs on tail while it is deployed
  • k

    Koci

    05/25/2023, 10:10 PM
    this is run on --remote
  • d

    DanTheGoodman

    05/25/2023, 10:12 PM
    no I mean im in the real time logs
  • d

    DanTheGoodman

    05/25/2023, 10:12 PM
    on the dashboard
  • k

    Koci

    05/25/2023, 10:12 PM
    Yeah that's what I mean as well
  • d

    DanTheGoodman

    05/25/2023, 10:13 PM
    I should definitely be getting them here no?

    https://cdn.discordapp.com/attachments/773219443911819284/1111416748210655282/image.png▾

  • d

    DanTheGoodman

    05/25/2023, 10:13 PM
    I know that the logs from the request get held, but i don't think that the handlers would be held too?
  • k

    Koci

    05/25/2023, 10:16 PM
    I think this does apply https://developers.cloudflare.com/workers/platform/changelog/#2021-06-17
  • k

    Koci

    05/25/2023, 10:17 PM
    I have never seen any console.logs from DO on the dashboard logs myself
  • d

    DanTheGoodman

    05/25/2023, 10:19 PM
    I see them once the request ends
1...563564565566567Latest