rwsdk 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,13 +50,18 @@ export class RealtimeDurableObject extends DurableObject {
50
50
  }
51
51
  async webSocketMessage(ws, data) {
52
52
  const clientId = ws.deserializeAttachment();
53
- const clientInfo = await this.getClientInfo(clientId);
53
+ let clientInfo = await this.getClientInfo(clientId);
54
54
  const message = new Uint8Array(data);
55
55
  const messageType = message[0];
56
56
  if (messageType === MESSAGE_TYPE.ACTION_REQUEST) {
57
57
  const decoder = new TextDecoder();
58
58
  const jsonData = decoder.decode(message.slice(1));
59
59
  const { id, args, requestId, clientUrl } = JSON.parse(jsonData);
60
+ clientInfo = {
61
+ ...clientInfo,
62
+ url: clientUrl,
63
+ };
64
+ await this.storeClientInfo(clientInfo);
60
65
  try {
61
66
  await this.handleAction(ws, id, args, clientInfo, requestId, clientUrl);
62
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {