molenzwiebel
04/21/2021, 7:58 PMmolenzwiebel
04/21/2021, 7:58 PMmolenzwiebel
04/21/2021, 8:00 PMvans163
04/21/2021, 8:01 PMvans163
04/21/2021, 8:02 PMkenton
04/21/2021, 8:09 PMwaitUntil
inside a DO is meaningless. Anything you do inside a DO will keep running until the object itself shuts down, which is typically after 30 seconds of being idle (no new requests).kenton
04/21/2021, 8:11 PMvans163
04/21/2021, 8:12 PMvans163
04/21/2021, 8:13 PMmolenzwiebel
04/21/2021, 8:18 PMkenton
04/21/2021, 8:20 PMsetTimeout(this.my_func, 1000)
won't work -- my_func
will be called without a this
, and probably throws an exception. You need to do setTimeout(this.my_func.bind(this), 1000)
or setTimeout(() => this.my_func(), 1000)
.kenton
04/21/2021, 8:22 PMmolenzwiebel
04/21/2021, 8:24 PMmatt
04/21/2021, 8:34 PMvans163
04/21/2021, 9:05 PMvans163
04/21/2021, 9:12 PMvans163
04/21/2021, 9:12 PMvans163
04/21/2021, 9:12 PMkenton
04/21/2021, 9:57 PMwrangler tail
should report uncaught exceptions but I'm not sure if it works yet for DO...vans163
04/22/2021, 12:27 AMvans163
04/22/2021, 12:37 AM// nothing happens, client is connected
session.websocket.close();
// client gets disconnected
session.websocket.close(1000, "no pong");
kenton
04/22/2021, 12:47 AM.close()
will throw an exception if you don't pass in a valid code. I guess the exception isn't getting caught. Sorry that errors are hard to see right now. FWIW I highly recommend wrapping all code in a try/catch of some sort and reporting the error somewhere.vans163
04/22/2021, 1:12 AMvans163
04/22/2021, 1:12 AMvans163
04/22/2021, 1:12 AMvans163
04/22/2021, 1:14 AMvans163
04/22/2021, 1:14 AMvans163
04/22/2021, 1:47 AMexport class User {
constructor(controller, env) {
this.account = this.constructor.name;
this does not seem to return the name of the DO for me, it just returns "S"vans163
04/22/2021, 1:51 AMthis.storage.put
does not seem to work if called from a setTimeout, could that be?