few suggestions / ideas

hello, we just upgraded from actor core(0.8) to rivetkit (0.9.9). Everything went smoothly really nice upgrade. Great job with lib 🙂 I have few things I noticed during upgrade: 1. onAuth: is there possibility that when I'm calling actor from frontend typescript client - params gets there as a string and when calling actor via fetch handler from backend it gets object properly? I needed to do:
const { organizationId, authToken, partnerId, chatId } =
typeof params === "string" ? JSON.parse(params) : params;
const { organizationId, authToken, partnerId, chatId } =
typeof params === "string" ? JSON.parse(params) : params;
otherwise it wasn't working in one of the scenarios (fetch handler(hono), / ts FE) 2. conn in createState: would be possible to have access to c.conn.auth in createState? I'm creating objects in state and want to assign permissions to them (ownerId/organizationId). It would be neat to have that ability - as I don't want to pass it in params/input... 3. onBeforeConnect and UserError: I wanted to have access to c.state when doing the auth but I wasn't able to get UserError to get propagated to frontend as it is in onAuth - if UserError was thrown in onBeforeConnect the websocket messages were empty. Would be nice improvement. 4. I had an little bit deeper object in onAuth result - "organization" with some more objects inside and I was getting some invalid / failed request when calling HTTP handlers - probably due to size of header. Maybe some best practices how to structure it would be nice.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?