@droponair/sdk-js 0.24.1 → 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,13 @@
|
|
|
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
|
+
|
|
7
|
+
## 0.24.2
|
|
8
|
+
|
|
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.
|
|
10
|
+
|
|
3
11
|
## 0.24.1
|
|
4
12
|
|
|
5
13
|
- Fix: incoming frame classifier misrouted server-pushed Event and Broadcast frames as group messages (protobuf field overlap), so `onBroadcast` never fired and events like `LIMIT_REACHED` were swallowed. Event is now probed with a strict type check before group/broadcast/ack, and group notifications additionally require `senderDeviceId`.
|
|
@@ -1580,7 +1580,12 @@ class MessagingClient {
|
|
|
1580
1580
|
plaintext = await this.cryptoService.decrypt(myPayload.encryptedPayload, sharedKey, {
|
|
1581
1581
|
messageId: notif.messageId,
|
|
1582
1582
|
senderId: notif.fromUserId,
|
|
1583
|
-
recipientId
|
|
1583
|
+
// AAD recipientId is the receiving user's own id — this MUST match the
|
|
1584
|
+
// sender's encrypt AAD, which binds recipientId to the target member's
|
|
1585
|
+
// userId (memberId). Using notif.groupId here (the previous value) never
|
|
1586
|
+
// matched, so E2EE group messages failed GCM auth on decrypt. android /
|
|
1587
|
+
// ios / unity already bind this to the recipient's own id.
|
|
1588
|
+
recipientId: this.currentUserId,
|
|
1584
1589
|
timestamp: notif.timestamp,
|
|
1585
1590
|
});
|
|
1586
1591
|
}
|
|
@@ -387,7 +387,9 @@ class ProtobufCodec {
|
|
|
387
387
|
tryDecodeAck(payload) {
|
|
388
388
|
try {
|
|
389
389
|
const decoded = AckType.decode(payload);
|
|
390
|
-
|
|
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)
|
|
479
|
-
//
|
|
480
|
-
//
|
|
481
|
-
|
|
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.
|
|
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.
|
|
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
|