@palbase/web 1.2.0 → 1.2.1

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.
package/dist/index.cjs CHANGED
@@ -2713,6 +2713,11 @@ var MessageHub = class {
2713
2713
  };
2714
2714
  }
2715
2715
  };
2716
+ function decodeSenderDeviceId(sender) {
2717
+ if (sender.length === 0) return null;
2718
+ const id = decodeUtf8(sender);
2719
+ return id.length > 0 ? id : null;
2720
+ }
2716
2721
  var MessageDeliverySource = class {
2717
2722
  constructor(rt, engine, hub, registry, messageStore, deviceId, selfUserId) {
2718
2723
  this.rt = rt;
@@ -2845,11 +2850,12 @@ var MessageDeliverySource = class {
2845
2850
  const decoded = decodeEnvelope(received.data);
2846
2851
  const { text, clientMsgId, replyTo } = decoded;
2847
2852
  const isReaction = decoded.type === "reaction" && decoded.reaction != null;
2853
+ const senderDeviceId = row.sender_device_id ?? decodeSenderDeviceId(received.sender);
2848
2854
  const stored = {
2849
2855
  id: `${group.rfcGroupId}#${row.server_seq}`,
2850
2856
  direction: "incoming",
2851
2857
  text,
2852
- senderDeviceId: row.sender_device_id ?? null,
2858
+ senderDeviceId,
2853
2859
  epoch: row.epoch,
2854
2860
  serverSeq: row.server_seq,
2855
2861
  at: Date.now(),
@@ -2882,7 +2888,7 @@ var MessageDeliverySource = class {
2882
2888
  kind: "application",
2883
2889
  group,
2884
2890
  text,
2885
- senderDeviceId: row.sender_device_id ?? null,
2891
+ senderDeviceId,
2886
2892
  epoch: row.epoch,
2887
2893
  serverSeq: row.server_seq,
2888
2894
  receivedAt: /* @__PURE__ */ new Date(),
@@ -5887,7 +5893,7 @@ function localStorageSessionStorage(key = DEFAULT_KEY) {
5887
5893
  }
5888
5894
 
5889
5895
  // src/version.ts
5890
- var VERSION = "1.2.0";
5896
+ var VERSION = "1.2.1";
5891
5897
 
5892
5898
  // src/internal.ts
5893
5899
  function getRuntime() {