@droponair/sdk-js 0.24.2 → 0.24.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.24.3
4
+
5
+ - Fix: broadcasts (and events/acks) misrouted. Inbound Ack/GroupAck discriminators now require a real SCREAMING_SNAKE ack token, so a BroadcastNotification (publisherId in the type slot) is no longer decoded as a GroupAck before reaching the broadcast branch. Completes the frame-classifier fix.
6
+
3
7
  ## 0.24.2
4
8
 
5
9
  - Fix: E2EE group message decryption failed because the decrypt AAD bound `recipientId` to the group id instead of the receiving user's own id (which is what the sender encrypts against). Now matches the sender and the other SDKs. Requires sdk-be that preserves the sender timestamp on group notifications.
@@ -387,7 +387,9 @@ class ProtobufCodec {
387
387
  tryDecodeAck(payload) {
388
388
  try {
389
389
  const decoded = AckType.decode(payload);
390
- if (!decoded.messageId || !decoded.type) {
390
+ // type must be a real ack type (SCREAMING_SNAKE); otherwise a broadcast /
391
+ // notification with a UUID or userId in field 2 would false-match as an Ack.
392
+ if (!decoded.messageId || !decoded.type || !/^[A-Z][A-Z0-9_]*$/.test(decoded.type)) {
391
393
  return null;
392
394
  }
393
395
  return decoded;
@@ -475,10 +477,11 @@ class ProtobufCodec {
475
477
  tryDecodeGroupAck(payload) {
476
478
  try {
477
479
  const decoded = GroupAckType.decode(payload);
478
- // Require type (field 3): an Ack {messageId(1), type(2)} otherwise decodes
479
- // as a GroupAck (its type lands in groupId, field 3 stays empty). Real
480
- // GroupAcks always carry a type.
481
- if (!decoded.messageId || !decoded.groupId || !decoded.type) {
480
+ // Require type (field 3) to be a real ack type (SCREAMING_SNAKE). Without the
481
+ // shape check a BroadcastNotification {broadcastId(1), channelId(2),
482
+ // publisherId(3)} satisfies messageId+groupId+type (publisherId lands in type)
483
+ // and is misrouted here instead of to the broadcast handler.
484
+ if (!decoded.messageId || !decoded.groupId || !decoded.type || !/^[A-Z][A-Z0-9_]*$/.test(decoded.type)) {
482
485
  return null;
483
486
  }
484
487
  return decoded;
package/dist/version.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * MINOR, additive feature (e.g. multi-device payloads, new call event type)
8
8
  * PATCH, bug-fix / perf improvement with no wire or API change
9
9
  */
10
- export declare const SDK_VERSION = "0.24.2";
10
+ export declare const SDK_VERSION = "0.24.3";
11
11
  /**
12
12
  * Binary encrypted-payload format version.
13
13
  * Included as the first byte of every encrypted payload so receivers can
package/dist/version.js CHANGED
@@ -10,7 +10,7 @@ exports.PROTOCOL_VERSION = exports.PAYLOAD_FORMAT_VERSION = exports.SDK_VERSION
10
10
  * MINOR, additive feature (e.g. multi-device payloads, new call event type)
11
11
  * PATCH, bug-fix / perf improvement with no wire or API change
12
12
  */
13
- exports.SDK_VERSION = '0.24.2';
13
+ exports.SDK_VERSION = '0.24.3';
14
14
  /**
15
15
  * Binary encrypted-payload format version.
16
16
  * Included as the first byte of every encrypted payload so receivers can
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droponair/sdk-js",
3
- "version": "0.24.2",
3
+ "version": "0.24.3",
4
4
  "description": "DropOnAir SDK for end-to-end encrypted messaging",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",