@open-e2ee/signal-protocol-sdk 0.1.0-alpha.8 → 0.1.0

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.
Files changed (205) hide show
  1. package/ADAPTERS.md +12 -12
  2. package/ARCHITECTURE.md +3 -3
  3. package/CHANGELOG.md +461 -0
  4. package/README.md +25 -15
  5. package/SECURITY.md +1 -1
  6. package/client/README.md +2 -2
  7. package/device/README.md +3 -1
  8. package/dist/client/client.d.ts +6 -6
  9. package/dist/client/client.js +6 -6
  10. package/dist/client/compose.d.ts +2 -2
  11. package/dist/client/index.d.ts +2 -2
  12. package/dist/device/expo-metadata.d.ts +26 -0
  13. package/dist/device/expo-metadata.d.ts.map +1 -0
  14. package/dist/device/expo-metadata.js +33 -0
  15. package/dist/device/expo-metadata.js.map +1 -0
  16. package/dist/device/index.d.ts +1 -1
  17. package/dist/device/index.d.ts.map +1 -1
  18. package/dist/device/index.js +5 -1
  19. package/dist/device/index.js.map +1 -1
  20. package/dist/device/provisioning.d.ts +4 -12
  21. package/dist/device/provisioning.d.ts.map +1 -1
  22. package/dist/device/provisioning.js +4 -21
  23. package/dist/device/provisioning.js.map +1 -1
  24. package/dist/index.d.ts +5 -5
  25. package/dist/index.js +5 -5
  26. package/dist/internal/crypto/symmetric/aes.d.ts.map +1 -1
  27. package/dist/internal/crypto/symmetric/aes.js +27 -30
  28. package/dist/internal/crypto/symmetric/aes.js.map +1 -1
  29. package/dist/internal/encoding/proto/primitives.d.ts +261 -6
  30. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  31. package/dist/internal/encoding/proto/primitives.js +468 -6
  32. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  33. package/dist/internal/encoding/proto/sender-key-message.d.ts +4 -3
  34. package/dist/internal/encoding/proto/sender-key-message.d.ts.map +1 -1
  35. package/dist/internal/encoding/proto/sender-key-message.js +97 -76
  36. package/dist/internal/encoding/proto/sender-key-message.js.map +1 -1
  37. package/dist/internal/encoding/proto/signal-message.d.ts +7 -2
  38. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  39. package/dist/internal/encoding/proto/signal-message.js +194 -110
  40. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  41. package/dist/internal/groups/manager.d.ts +24 -5
  42. package/dist/internal/groups/manager.d.ts.map +1 -1
  43. package/dist/internal/groups/manager.js +33 -11
  44. package/dist/internal/groups/manager.js.map +1 -1
  45. package/dist/internal/groups/server-engine.d.ts +29 -14
  46. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  47. package/dist/internal/groups/server-engine.js +63 -14
  48. package/dist/internal/groups/server-engine.js.map +1 -1
  49. package/dist/internal/manager/manager.d.ts +2 -2
  50. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +50 -4
  51. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  52. package/dist/internal/protocol/sealed-sender/proto/index.js +273 -151
  53. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  54. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts +7 -1
  55. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts.map +1 -1
  56. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js +334 -151
  57. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js.map +1 -1
  58. package/dist/layers.d.ts +2 -2
  59. package/dist/layers.d.ts.map +1 -1
  60. package/dist/layers.js +2 -2
  61. package/dist/layers.js.map +1 -1
  62. package/dist/local/store/index.d.ts +3 -3
  63. package/dist/local/store/index.d.ts.map +1 -1
  64. package/dist/local/store/index.js +4 -4
  65. package/dist/local/store/index.js.map +1 -1
  66. package/dist/local/store/{mock → memory}/adapter.d.ts +10 -10
  67. package/dist/local/store/memory/adapter.d.ts.map +1 -0
  68. package/dist/local/store/{mock → memory}/adapter.js +5 -5
  69. package/dist/local/store/memory/adapter.js.map +1 -0
  70. package/dist/local/store/{mock → memory}/failures.d.ts +6 -6
  71. package/dist/local/store/memory/failures.d.ts.map +1 -0
  72. package/dist/local/store/{mock → memory}/failures.js +6 -6
  73. package/dist/local/store/memory/failures.js.map +1 -0
  74. package/dist/local/store/memory/index.d.ts +11 -0
  75. package/dist/local/store/memory/index.d.ts.map +1 -0
  76. package/dist/local/store/memory/index.js +7 -0
  77. package/dist/local/store/memory/index.js.map +1 -0
  78. package/dist/local/store/node/adapter.d.ts +53 -4
  79. package/dist/local/store/node/adapter.d.ts.map +1 -1
  80. package/dist/local/store/node/adapter.js +456 -9
  81. package/dist/local/store/node/adapter.js.map +1 -1
  82. package/dist/local/store/node/database.d.ts +68 -0
  83. package/dist/local/store/node/database.d.ts.map +1 -1
  84. package/dist/local/store/node/database.js +201 -18
  85. package/dist/local/store/node/database.js.map +1 -1
  86. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  87. package/dist/local/store/react-native/adapter.js +69 -1
  88. package/dist/local/store/react-native/adapter.js.map +1 -1
  89. package/dist/local/store/react-native/backend-conformance.d.ts +66 -0
  90. package/dist/local/store/react-native/backend-conformance.d.ts.map +1 -0
  91. package/dist/local/store/react-native/backend-conformance.js +326 -0
  92. package/dist/local/store/react-native/backend-conformance.js.map +1 -0
  93. package/dist/local/store/react-native/index.d.ts +9 -4
  94. package/dist/local/store/react-native/index.d.ts.map +1 -1
  95. package/dist/local/store/react-native/index.js +2 -0
  96. package/dist/local/store/react-native/index.js.map +1 -1
  97. package/dist/local/store/react-native/reference-backend.d.ts +42 -0
  98. package/dist/local/store/react-native/reference-backend.d.ts.map +1 -0
  99. package/dist/local/store/react-native/reference-backend.js +177 -0
  100. package/dist/local/store/react-native/reference-backend.js.map +1 -0
  101. package/dist/local/store/react-native/storage.d.ts +9 -0
  102. package/dist/local/store/react-native/storage.d.ts.map +1 -1
  103. package/dist/local/store/web/adapter.d.ts +11 -1
  104. package/dist/local/store/web/adapter.d.ts.map +1 -1
  105. package/dist/local/store/web/adapter.js +196 -33
  106. package/dist/local/store/web/adapter.js.map +1 -1
  107. package/dist/local/store/web/index.d.ts +3 -2
  108. package/dist/local/store/web/index.d.ts.map +1 -1
  109. package/dist/local/store/web/index.js.map +1 -1
  110. package/dist/local/vault/index.d.ts +5 -1
  111. package/dist/local/vault/index.d.ts.map +1 -1
  112. package/dist/local/vault/index.js +1 -1
  113. package/dist/local/vault/index.js.map +1 -1
  114. package/dist/remote/relay/convex/backend.d.ts +9 -6
  115. package/dist/remote/relay/convex/backend.d.ts.map +1 -1
  116. package/dist/remote/relay/convex/backend.js +4 -1
  117. package/dist/remote/relay/convex/backend.js.map +1 -1
  118. package/dist/remote/relay/convex/component/_generated/component.d.ts +10 -7
  119. package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -1
  120. package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -1
  121. package/dist/remote/relay/convex/component/certificates.js +26 -31
  122. package/dist/remote/relay/convex/component/certificates.js.map +1 -1
  123. package/dist/remote/relay/convex/component/cleanup.d.ts +6 -0
  124. package/dist/remote/relay/convex/component/cleanup.d.ts.map +1 -1
  125. package/dist/remote/relay/convex/component/cleanup.js +19 -0
  126. package/dist/remote/relay/convex/component/cleanup.js.map +1 -1
  127. package/dist/remote/relay/convex/component/crons.d.ts.map +1 -1
  128. package/dist/remote/relay/convex/component/crons.js +1 -0
  129. package/dist/remote/relay/convex/component/crons.js.map +1 -1
  130. package/dist/remote/relay/convex/component/groups.d.ts +9 -6
  131. package/dist/remote/relay/convex/component/groups.d.ts.map +1 -1
  132. package/dist/remote/relay/convex/component/groups.js +21 -11
  133. package/dist/remote/relay/convex/component/groups.js.map +1 -1
  134. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -1
  135. package/dist/remote/relay/convex/component/messages.js +90 -16
  136. package/dist/remote/relay/convex/component/messages.js.map +1 -1
  137. package/dist/remote/relay/convex/component/schema.d.ts +15 -1
  138. package/dist/remote/relay/convex/component/schema.js +21 -0
  139. package/dist/remote/relay/convex/component/schema.js.map +1 -1
  140. package/dist/remote/relay/convex/group-server.d.ts +6 -5
  141. package/dist/remote/relay/convex/group-server.d.ts.map +1 -1
  142. package/dist/remote/relay/convex/group-server.js +14 -10
  143. package/dist/remote/relay/convex/group-server.js.map +1 -1
  144. package/dist/remote/relay/convex/relay.d.ts +2 -2
  145. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  146. package/dist/remote/relay/convex/relay.js +10 -7
  147. package/dist/remote/relay/convex/relay.js.map +1 -1
  148. package/dist/remote/relay/index.d.ts +1 -1
  149. package/dist/remote/relay/index.d.ts.map +1 -1
  150. package/dist/remote/relay/index.js +2 -2
  151. package/dist/remote/relay/index.js.map +1 -1
  152. package/dist/remote/relay/{mock → memory}/adapter.d.ts +19 -19
  153. package/dist/remote/relay/memory/adapter.d.ts.map +1 -0
  154. package/dist/remote/relay/{mock → memory}/adapter.js +24 -19
  155. package/dist/remote/relay/memory/adapter.js.map +1 -0
  156. package/dist/remote/relay/{mock → memory}/failures.d.ts +5 -5
  157. package/dist/remote/relay/memory/failures.d.ts.map +1 -0
  158. package/dist/remote/relay/{mock → memory}/failures.js +1 -1
  159. package/dist/remote/relay/memory/failures.js.map +1 -0
  160. package/dist/remote/relay/{mock → memory}/group-server.d.ts +1 -1
  161. package/dist/remote/relay/memory/group-server.d.ts.map +1 -0
  162. package/dist/remote/relay/{mock → memory}/group-server.js +1 -1
  163. package/dist/remote/relay/memory/group-server.js.map +1 -0
  164. package/dist/remote/relay/memory/index.d.ts +11 -0
  165. package/dist/remote/relay/memory/index.d.ts.map +1 -0
  166. package/dist/remote/relay/memory/index.js +7 -0
  167. package/dist/remote/relay/memory/index.js.map +1 -0
  168. package/dist/remote/relay/types.d.ts +25 -6
  169. package/dist/remote/relay/types.d.ts.map +1 -1
  170. package/dist/types/errors.d.ts +33 -0
  171. package/dist/types/errors.d.ts.map +1 -1
  172. package/dist/types/errors.js +36 -0
  173. package/dist/types/errors.js.map +1 -1
  174. package/docs/ASSURANCE.md +50 -15
  175. package/docs/CLIENT_COMPOSITION.md +3 -3
  176. package/docs/GETTING_STARTED.md +11 -11
  177. package/docs/PACKAGE_SURFACE.md +10 -8
  178. package/docs/RECIPES.md +12 -12
  179. package/local/store/README.md +98 -9
  180. package/local/store/{mock → memory}/README.md +8 -8
  181. package/local/store/node/README.md +6 -8
  182. package/local/store/react-native/README.md +34 -2
  183. package/local/store/web/README.md +30 -3
  184. package/package.json +13 -10
  185. package/remote/README.md +7 -7
  186. package/remote/relay/README.md +5 -5
  187. package/remote/relay/{mock → memory}/README.md +8 -8
  188. package/dist/local/store/mock/adapter.d.ts.map +0 -1
  189. package/dist/local/store/mock/adapter.js.map +0 -1
  190. package/dist/local/store/mock/failures.d.ts.map +0 -1
  191. package/dist/local/store/mock/failures.js.map +0 -1
  192. package/dist/local/store/mock/index.d.ts +0 -11
  193. package/dist/local/store/mock/index.d.ts.map +0 -1
  194. package/dist/local/store/mock/index.js +0 -7
  195. package/dist/local/store/mock/index.js.map +0 -1
  196. package/dist/remote/relay/mock/adapter.d.ts.map +0 -1
  197. package/dist/remote/relay/mock/adapter.js.map +0 -1
  198. package/dist/remote/relay/mock/failures.d.ts.map +0 -1
  199. package/dist/remote/relay/mock/failures.js.map +0 -1
  200. package/dist/remote/relay/mock/group-server.d.ts.map +0 -1
  201. package/dist/remote/relay/mock/group-server.js.map +0 -1
  202. package/dist/remote/relay/mock/index.d.ts +0 -11
  203. package/dist/remote/relay/mock/index.d.ts.map +0 -1
  204. package/dist/remote/relay/mock/index.js +0 -7
  205. package/dist/remote/relay/mock/index.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * SignalProtocolMessage / PreKeySignalProtocolMessage Protobuf Encoding/Decoding
3
3
  *
4
- * Encodes and decodes SignalProtocolMessage and PreKeySignalProtocolMessage with protobufjs.
4
+ * Hand-written static codecs for SignalProtocolMessage and
5
+ * PreKeySignalProtocolMessage, built on the shared wire primitives.
5
6
  * These are the core message types of the Signal Protocol's Double Ratchet.
6
7
  *
7
8
  * Proto schema:
@@ -40,9 +41,7 @@
40
41
  *
41
42
  * @internal
42
43
  */
43
- import protobuf from 'protobufjs';
44
- import { decodeVarint, encodeVarint } from './primitives.js';
45
- const root = new protobuf.Root();
44
+ import { ProtoReader, concatFields, decodeVarint, encodeBytesField, encodeUint32Field, encodeVarint, } from './primitives.js';
46
45
  // Bound adversarial protobuf work without constraining the documented 10 MiB
47
46
  // message contract. Larger payloads use the separately bounded attachment path.
48
47
  export const MAX_SIGNAL_PROTOCOL_WIRE_MESSAGE_BYTES = 16 * 1024 * 1024;
@@ -52,23 +51,44 @@ function assertWireMessageSize(bytes, label) {
52
51
  }
53
52
  }
54
53
  /**
55
- * SignalProtocolMessage protobuf type.
54
+ * SignalProtocolMessage wire field numbers.
56
55
  *
57
- * Wire fields:
58
56
  * - ratchet_key (1, bytes) - current ratchet public key
59
57
  * - counter (2, uint32) - message number in current chain
60
58
  * - previous_counter (3, uint32) - length of previous sending chain
61
59
  * - ciphertext (4, bytes) - encrypted message content
62
60
  * - pq_ratchet (5, bytes) - opaque SPQR binary data (NOT protobuf)
61
+ * - addresses (6, bytes) - sender/recipient address binding
62
+ * - recipient_identity_type (100, uint32) - SDK extension
63
63
  */
64
- const SignalProtocolMessageType = new protobuf.Type('SignalProtocolMessage')
65
- .add(new protobuf.Field('ratchetKey', 1, 'bytes'))
66
- .add(new protobuf.Field('counter', 2, 'uint32'))
67
- .add(new protobuf.Field('previousCounter', 3, 'uint32'))
68
- .add(new protobuf.Field('ciphertext', 4, 'bytes'))
69
- .add(new protobuf.Field('pqRatchet', 5, 'bytes'))
70
- .add(new protobuf.Field('addresses', 6, 'bytes'))
71
- .add(new protobuf.Field('recipientIdentityType', 100, 'uint32', 'optional'));
64
+ const SIGNAL_MESSAGE_FIELD = {
65
+ ratchetKey: 1,
66
+ counter: 2,
67
+ previousCounter: 3,
68
+ ciphertext: 4,
69
+ pqRatchet: 5,
70
+ addresses: 6,
71
+ recipientIdentityType: 100,
72
+ };
73
+ /**
74
+ * PreKeySignalProtocolMessage wire field numbers.
75
+ *
76
+ * Fields 1-8 are the base PreKeySignalProtocolMessage fields. Fields 100-102
77
+ * are SDK extensions for KEM one-time prekeys and recipient identity scope.
78
+ */
79
+ const PREKEY_MESSAGE_FIELD = {
80
+ oneTimePreKeyId: 1,
81
+ baseKey: 2,
82
+ identityKey: 3,
83
+ message: 4,
84
+ registrationId: 5,
85
+ signedPreKeyId: 6,
86
+ kyberPreKeyId: 7,
87
+ kyberCiphertext: 8,
88
+ kemOneTimePreKeyId: 100,
89
+ kemOneTimeCiphertext: 101,
90
+ recipientIdentityType: 102,
91
+ };
72
92
  const ADDRESS_BINDING_FORMAT_VERSION = 1;
73
93
  function encodeUint32BE(value) {
74
94
  if (!Number.isInteger(value) || value < 0 || value > 0xffffffff) {
@@ -151,33 +171,6 @@ export function signalProtocolMessageAddressesEqual(encoded, senderAddress, reci
151
171
  decoded.recipientAddress.userId === recipientAddress.userId &&
152
172
  decoded.recipientAddress.deviceId === recipientAddress.deviceId);
153
173
  }
154
- /**
155
- * PreKeySignalProtocolMessage protobuf type.
156
- *
157
- * Fields 1-8 are the base PreKeySignalProtocolMessage fields. Fields 100-102 are SDK
158
- * extensions for KEM one-time prekeys and recipient identity scope.
159
- */
160
- const PreKeySignalProtocolMessageType = new protobuf.Type('PreKeySignalProtocolMessage')
161
- // oneTimePreKeyId uses 'optional' rule (proto2 semantics) so that value 0 is
162
- // distinguished from "not set" using proto2 optional presence.
163
- // Without this, protobufjs proto3 default behavior omits 0 on encode and
164
- // makes 0 indistinguishable from absent on decode — breaking X3DH when
165
- // the one-time prekey has keyId=0.
166
- .add(new protobuf.Field('oneTimePreKeyId', 1, 'uint32', 'optional'))
167
- .add(new protobuf.Field('baseKey', 2, 'bytes'))
168
- .add(new protobuf.Field('identityKey', 3, 'bytes'))
169
- .add(new protobuf.Field('message', 4, 'bytes'))
170
- .add(new protobuf.Field('registrationId', 5, 'uint32'))
171
- .add(new protobuf.Field('signedPreKeyId', 6, 'uint32'))
172
- // kyberPreKeyId and kemOneTimePreKeyId also use 'optional' for the same reason
173
- .add(new protobuf.Field('kyberPreKeyId', 7, 'uint32', 'optional'))
174
- .add(new protobuf.Field('kyberCiphertext', 8, 'bytes'))
175
- // Custom extension fields (high field numbers to avoid upstream conflicts)
176
- .add(new protobuf.Field('kemOneTimePreKeyId', 100, 'uint32', 'optional'))
177
- .add(new protobuf.Field('kemOneTimeCiphertext', 101, 'bytes'))
178
- .add(new protobuf.Field('recipientIdentityType', 102, 'uint32', 'optional'));
179
- root.add(SignalProtocolMessageType);
180
- root.add(PreKeySignalProtocolMessageType);
181
174
  /**
182
175
  * Encode a SignalProtocolMessage to protobuf bytes.
183
176
  *
@@ -188,6 +181,11 @@ root.add(PreKeySignalProtocolMessageType);
188
181
  * This produces the **protobuf bytes only** — no version byte or MAC.
189
182
  * Use `frameSignalProtocolMessage()` from `envelope.ts` for the complete wire format.
190
183
  *
184
+ * Presence, not proto3 defaults, decides what reaches the wire: a field the
185
+ * caller set is written even when it equals the type's zero value, so a
186
+ * counter of 0 and a key id of 0 are distinguishable from absent. Fields are
187
+ * written in ascending field-number order.
188
+ *
191
189
  * @param msg - Message fields to encode
192
190
  * @returns Protobuf-encoded bytes (no framing)
193
191
  *
@@ -196,24 +194,32 @@ export function encodeSignalProtocolMessage(msg) {
196
194
  if (!msg.addresses?.length) {
197
195
  throw new Error('SignalProtocolMessage addresses field is required');
198
196
  }
199
- const payload = {
200
- ratchetKey: msg.ratchetKey,
201
- counter: msg.counter,
202
- previousCounter: msg.previousCounter,
203
- ciphertext: msg.ciphertext,
204
- addresses: msg.addresses,
205
- };
197
+ if (msg.recipientIdentityType !== undefined &&
198
+ msg.recipientIdentityType !== 1 &&
199
+ msg.recipientIdentityType !== 2) {
200
+ throw new Error('SignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
201
+ }
202
+ const fields = [];
203
+ if (msg.ratchetKey !== undefined) {
204
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.ratchetKey, msg.ratchetKey));
205
+ }
206
+ if (msg.counter !== undefined) {
207
+ fields.push(encodeUint32Field(SIGNAL_MESSAGE_FIELD.counter, msg.counter));
208
+ }
209
+ if (msg.previousCounter !== undefined) {
210
+ fields.push(encodeUint32Field(SIGNAL_MESSAGE_FIELD.previousCounter, msg.previousCounter));
211
+ }
212
+ if (msg.ciphertext !== undefined) {
213
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.ciphertext, msg.ciphertext));
214
+ }
206
215
  if (msg.pqRatchet !== undefined) {
207
- payload.pqRatchet = msg.pqRatchet;
216
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.pqRatchet, msg.pqRatchet));
208
217
  }
218
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.addresses, msg.addresses));
209
219
  if (msg.recipientIdentityType !== undefined) {
210
- if (msg.recipientIdentityType !== 1 && msg.recipientIdentityType !== 2) {
211
- throw new Error('SignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
212
- }
213
- payload.recipientIdentityType = msg.recipientIdentityType;
220
+ fields.push(encodeUint32Field(SIGNAL_MESSAGE_FIELD.recipientIdentityType, msg.recipientIdentityType));
214
221
  }
215
- const message = SignalProtocolMessageType.create(payload);
216
- return new Uint8Array(SignalProtocolMessageType.encode(message).finish());
222
+ return concatFields(...fields);
217
223
  }
218
224
  /**
219
225
  * Decode a SignalProtocolMessage from protobuf bytes.
@@ -227,33 +233,64 @@ export function encodeSignalProtocolMessage(msg) {
227
233
  */
228
234
  export function decodeSignalProtocolMessage(bytes) {
229
235
  assertWireMessageSize(bytes, 'SignalProtocolMessage');
230
- const decoded = SignalProtocolMessageType.decode(bytes);
231
- const message = SignalProtocolMessageType.toObject(decoded, {
232
- defaults: false,
233
- bytes: Uint8Array,
234
- });
235
- if (!message.addresses?.length) {
236
+ let ratchetKey;
237
+ let counter;
238
+ let previousCounter;
239
+ let ciphertext;
240
+ let pqRatchet;
241
+ let addresses;
242
+ let recipientIdentityType;
243
+ const reader = new ProtoReader(bytes);
244
+ while (reader.hasMore()) {
245
+ const { fieldNumber } = reader.readTag();
246
+ switch (fieldNumber) {
247
+ case SIGNAL_MESSAGE_FIELD.ratchetKey:
248
+ ratchetKey = reader.readBytes();
249
+ break;
250
+ case SIGNAL_MESSAGE_FIELD.counter:
251
+ counter = reader.readUint32();
252
+ break;
253
+ case SIGNAL_MESSAGE_FIELD.previousCounter:
254
+ previousCounter = reader.readUint32();
255
+ break;
256
+ case SIGNAL_MESSAGE_FIELD.ciphertext:
257
+ ciphertext = reader.readBytes();
258
+ break;
259
+ case SIGNAL_MESSAGE_FIELD.pqRatchet:
260
+ pqRatchet = reader.readBytes();
261
+ break;
262
+ case SIGNAL_MESSAGE_FIELD.addresses:
263
+ addresses = reader.readBytes();
264
+ break;
265
+ case SIGNAL_MESSAGE_FIELD.recipientIdentityType:
266
+ recipientIdentityType = reader.readUint32();
267
+ break;
268
+ default:
269
+ reader.skipField();
270
+ }
271
+ }
272
+ if (!addresses?.length) {
236
273
  throw new Error('Missing required field: addresses');
237
274
  }
238
- if (message.ratchetKey?.length !== 33) {
275
+ if (ratchetKey?.length !== 33) {
239
276
  throw new Error('SignalProtocolMessage ratchetKey must contain exactly 33 bytes');
240
277
  }
241
- if (!message.ciphertext?.length) {
278
+ if (!ciphertext?.length) {
242
279
  throw new Error('SignalProtocolMessage ciphertext must not be empty');
243
280
  }
244
- if (message.recipientIdentityType !== undefined &&
245
- message.recipientIdentityType !== 1 &&
246
- message.recipientIdentityType !== 2) {
281
+ if (recipientIdentityType !== undefined &&
282
+ recipientIdentityType !== 1 &&
283
+ recipientIdentityType !== 2) {
247
284
  throw new Error('SignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
248
285
  }
249
286
  return {
250
- ratchetKey: new Uint8Array(message.ratchetKey),
251
- counter: message.counter >>> 0,
252
- previousCounter: message.previousCounter >>> 0,
253
- ciphertext: new Uint8Array(message.ciphertext),
254
- pqRatchet: message.pqRatchet?.length ? new Uint8Array(message.pqRatchet) : undefined,
255
- addresses: new Uint8Array(message.addresses),
256
- recipientIdentityType: message.recipientIdentityType,
287
+ ratchetKey,
288
+ counter: counter ?? 0,
289
+ previousCounter: previousCounter ?? 0,
290
+ ciphertext,
291
+ pqRatchet: pqRatchet?.length ? pqRatchet : undefined,
292
+ addresses,
293
+ recipientIdentityType,
257
294
  };
258
295
  }
259
296
  /**
@@ -273,31 +310,43 @@ export function encodePreKeySignalProtocolMessage(msg) {
273
310
  throw new Error('PreKeySignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
274
311
  }
275
312
  // Map TS interface names → proto wire field names
276
- const payload = {
277
- baseKey: msg.baseKey,
278
- identityKey: msg.identityKey,
279
- message: msg.message,
280
- registrationId: msg.registrationId,
281
- signedPreKeyId: msg.ecSignedPreKeyId, // TS ecSignedPreKeyId → wire signedPreKeyId
282
- recipientIdentityType: msg.recipientIdentityType,
283
- };
313
+ const fields = [];
284
314
  if (msg.ecOneTimePreKeyId !== undefined) {
285
- payload.oneTimePreKeyId = msg.ecOneTimePreKeyId; // TS ecOneTimePreKeyId → wire oneTimePreKeyId
315
+ // TS ecOneTimePreKeyId → wire oneTimePreKeyId
316
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.oneTimePreKeyId, msg.ecOneTimePreKeyId));
317
+ }
318
+ if (msg.baseKey !== undefined) {
319
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.baseKey, msg.baseKey));
320
+ }
321
+ if (msg.identityKey !== undefined) {
322
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.identityKey, msg.identityKey));
323
+ }
324
+ if (msg.message !== undefined) {
325
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.message, msg.message));
326
+ }
327
+ if (msg.registrationId !== undefined) {
328
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.registrationId, msg.registrationId));
329
+ }
330
+ if (msg.ecSignedPreKeyId !== undefined) {
331
+ // TS ecSignedPreKeyId → wire signedPreKeyId
332
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.signedPreKeyId, msg.ecSignedPreKeyId));
286
333
  }
287
334
  if (msg.kemLastResortPreKeyId !== undefined) {
288
- payload.kyberPreKeyId = msg.kemLastResortPreKeyId; // TS kemLastResortPreKeyId → wire kyberPreKeyId
335
+ // TS kemLastResortPreKeyId → wire kyberPreKeyId
336
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.kyberPreKeyId, msg.kemLastResortPreKeyId));
289
337
  }
290
338
  if (msg.kemLastResortCiphertext !== undefined) {
291
- payload.kyberCiphertext = msg.kemLastResortCiphertext; // TS kemLastResortCiphertext → wire kyberCiphertext
339
+ // TS kemLastResortCiphertext → wire kyberCiphertext
340
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.kyberCiphertext, msg.kemLastResortCiphertext));
292
341
  }
293
342
  if (msg.kemOneTimePreKeyId !== undefined) {
294
- payload.kemOneTimePreKeyId = msg.kemOneTimePreKeyId;
343
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.kemOneTimePreKeyId, msg.kemOneTimePreKeyId));
295
344
  }
296
345
  if (msg.kemOneTimeCiphertext !== undefined) {
297
- payload.kemOneTimeCiphertext = msg.kemOneTimeCiphertext;
346
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.kemOneTimeCiphertext, msg.kemOneTimeCiphertext));
298
347
  }
299
- const message = PreKeySignalProtocolMessageType.create(payload);
300
- return new Uint8Array(PreKeySignalProtocolMessageType.encode(message).finish());
348
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.recipientIdentityType, msg.recipientIdentityType));
349
+ return concatFields(...fields);
301
350
  }
302
351
  /**
303
352
  * Decode a PreKeySignalProtocolMessage from protobuf bytes.
@@ -311,15 +360,51 @@ export function encodePreKeySignalProtocolMessage(msg) {
311
360
  */
312
361
  export function decodePreKeySignalProtocolMessage(bytes) {
313
362
  assertWireMessageSize(bytes, 'PreKeySignalProtocolMessage');
314
- const decoded = PreKeySignalProtocolMessageType.decode(bytes);
315
- // Use toObject with defaults:false so that absent optional fields are omitted
316
- // (undefined) while present fields retain their value — including 0.
317
- // Proto2 optional presence makes value 0 a valid key ID, distinct
318
- // from "field not set".
319
- const wireMessage = PreKeySignalProtocolMessageType.toObject(decoded, {
320
- defaults: false,
321
- bytes: Uint8Array,
322
- });
363
+ // Every field is tracked by presence, so an absent field stays undefined
364
+ // while a present one keeps its value — including 0. Proto2 optional
365
+ // presence makes value 0 a valid key ID, distinct from "field not set".
366
+ const wireMessage = {};
367
+ const reader = new ProtoReader(bytes);
368
+ while (reader.hasMore()) {
369
+ const { fieldNumber } = reader.readTag();
370
+ switch (fieldNumber) {
371
+ case PREKEY_MESSAGE_FIELD.oneTimePreKeyId:
372
+ wireMessage.oneTimePreKeyId = reader.readUint32();
373
+ break;
374
+ case PREKEY_MESSAGE_FIELD.baseKey:
375
+ wireMessage.baseKey = reader.readBytes();
376
+ break;
377
+ case PREKEY_MESSAGE_FIELD.identityKey:
378
+ wireMessage.identityKey = reader.readBytes();
379
+ break;
380
+ case PREKEY_MESSAGE_FIELD.message:
381
+ wireMessage.message = reader.readBytes();
382
+ break;
383
+ case PREKEY_MESSAGE_FIELD.registrationId:
384
+ wireMessage.registrationId = reader.readUint32();
385
+ break;
386
+ case PREKEY_MESSAGE_FIELD.signedPreKeyId:
387
+ wireMessage.signedPreKeyId = reader.readUint32();
388
+ break;
389
+ case PREKEY_MESSAGE_FIELD.kyberPreKeyId:
390
+ wireMessage.kyberPreKeyId = reader.readUint32();
391
+ break;
392
+ case PREKEY_MESSAGE_FIELD.kyberCiphertext:
393
+ wireMessage.kyberCiphertext = reader.readBytes();
394
+ break;
395
+ case PREKEY_MESSAGE_FIELD.kemOneTimePreKeyId:
396
+ wireMessage.kemOneTimePreKeyId = reader.readUint32();
397
+ break;
398
+ case PREKEY_MESSAGE_FIELD.kemOneTimeCiphertext:
399
+ wireMessage.kemOneTimeCiphertext = reader.readBytes();
400
+ break;
401
+ case PREKEY_MESSAGE_FIELD.recipientIdentityType:
402
+ wireMessage.recipientIdentityType = reader.readUint32();
403
+ break;
404
+ default:
405
+ reader.skipField();
406
+ }
407
+ }
323
408
  if (wireMessage.baseKey?.length !== 33) {
324
409
  throw new Error('PreKeySignalProtocolMessage baseKey must contain exactly 33 bytes');
325
410
  }
@@ -341,31 +426,30 @@ export function decodePreKeySignalProtocolMessage(bytes) {
341
426
  }
342
427
  // Map proto wire names → TS interface names
343
428
  const result = {
344
- baseKey: new Uint8Array(wireMessage.baseKey),
345
- identityKey: new Uint8Array(wireMessage.identityKey),
346
- message: new Uint8Array(wireMessage.message),
347
- registrationId: wireMessage.registrationId >>> 0,
348
- ecSignedPreKeyId: wireMessage.signedPreKeyId >>> 0, // wire signedPreKeyId → TS ecSignedPreKeyId
429
+ baseKey: wireMessage.baseKey,
430
+ identityKey: wireMessage.identityKey,
431
+ message: wireMessage.message,
432
+ registrationId: wireMessage.registrationId,
433
+ ecSignedPreKeyId: wireMessage.signedPreKeyId, // wire signedPreKeyId → TS ecSignedPreKeyId
349
434
  recipientIdentityType: wireMessage.recipientIdentityType,
350
435
  };
351
- // Optional fields: with toObject({defaults:false}), absent fields are undefined
352
- // and present fields have their value (including 0), preserving proto2
353
- // optional-field semantics.
436
+ // Optional fields: an absent field is undefined and a present one has its
437
+ // value (including 0), preserving proto2 optional-field semantics.
354
438
  if (wireMessage.oneTimePreKeyId !== undefined) {
355
- result.ecOneTimePreKeyId = wireMessage.oneTimePreKeyId >>> 0; // wire oneTimePreKeyId → TS ecOneTimePreKeyId
439
+ result.ecOneTimePreKeyId = wireMessage.oneTimePreKeyId; // wire oneTimePreKeyId → TS ecOneTimePreKeyId
356
440
  }
357
441
  if (wireMessage.kyberPreKeyId !== undefined) {
358
- result.kemLastResortPreKeyId = wireMessage.kyberPreKeyId >>> 0; // wire kyberPreKeyId → TS kemLastResortPreKeyId
442
+ result.kemLastResortPreKeyId = wireMessage.kyberPreKeyId; // wire kyberPreKeyId → TS kemLastResortPreKeyId
359
443
  }
360
444
  if (wireMessage.kyberCiphertext?.length) {
361
- result.kemLastResortCiphertext = new Uint8Array(wireMessage.kyberCiphertext); // wire kyberCiphertext → TS kemLastResortCiphertext
445
+ result.kemLastResortCiphertext = wireMessage.kyberCiphertext; // wire kyberCiphertext → TS kemLastResortCiphertext
362
446
  }
363
447
  // Optional custom extension fields (100-101) — already use correct names
364
448
  if (wireMessage.kemOneTimePreKeyId !== undefined) {
365
- result.kemOneTimePreKeyId = wireMessage.kemOneTimePreKeyId >>> 0;
449
+ result.kemOneTimePreKeyId = wireMessage.kemOneTimePreKeyId;
366
450
  }
367
451
  if (wireMessage.kemOneTimeCiphertext?.length) {
368
- result.kemOneTimeCiphertext = new Uint8Array(wireMessage.kemOneTimeCiphertext);
452
+ result.kemOneTimeCiphertext = wireMessage.kemOneTimeCiphertext;
369
453
  }
370
454
  return result;
371
455
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signal-message.js","sourceRoot":"","sources":["../../../../internal/encoding/proto/signal-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAM1D,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;AACjC,6EAA6E;AAC7E,gFAAgF;AAChF,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvE,SAAS,qBAAqB,CAAC,KAAiB,EAAE,KAAa;IAC7D,IAAI,KAAK,CAAC,MAAM,GAAG,sCAAsC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,sCAAsC,mBAAmB,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAA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BAAgB,EAAE,WAAW,CAAC,cAAc,KAAK,CAAC,EAAE,4CAA4C;QAChG,qBAAqB,EAAE,WAAW,CAAC,qBAAqB;KACzD,CAAC;IAEF,gFAAgF;IAChF,uEAAuE;IACvE,4BAA4B;IAC5B,IAAI,WAAW,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,CAAC,iBAAiB,GAAG,WAAW,CAAC,eAAe,KAAK,CAAC,CAAC,CAAC,8CAA8C;IAC9G,CAAC;IACD,IAAI,WAAW,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC5C,MAAM,CAAC,qBAAqB,GAAG,WAAW,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,gDAAgD;IAClH,CAAC;IACD,IAAI,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;QACxC,MAAM,CAAC,uBAAuB,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,oDAAoD;IACpI,CAAC;IAED,yEAAyE;IACzE,IAAI,WAAW,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACjD,MAAM,CAAC,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,KAAK,CAAC,CAAC;IACnE,CAAC;IACD,IAAI,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,CAAC;QAC7C,MAAM,CAAC,oBAAoB,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"signal-message.js","sourceRoot":"","sources":["../../../../internal/encoding/proto/signal-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC;AAMtB,6EAA6E;AAC7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G,CAAC;IACD,IAAI,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;QACxC,MAAM,CAAC,uBAAuB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC,oDAAoD;IACpH,CAAC;IAED,yEAAyE;IACzE,IAAI,WAAW,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACjD,MAAM,CAAC,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC;IAC7D,CAAC;IACD,IAAI,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,CAAC;QAC7C,MAAM,CAAC,oBAAoB,GAAG,WAAW,CAAC,oBAAoB,CAAC;IACjE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -94,13 +94,17 @@ export interface IGroupServer {
94
94
  version: number;
95
95
  } | null>;
96
96
  /**
97
- * Get the authorized change-log prefix after a historical version.
97
+ * Get one page of the authorized change log after a historical version.
98
98
  *
99
- * Authorization is evaluated at the `fromVersion` snapshot. The response
100
- * includes the first transition that makes the requester unreadable, then
101
- * stops; a requester already unreadable at that snapshot is refused.
99
+ * Authorization is evaluated at the `fromVersion` snapshot, and the
100
+ * requester must be a member there (S10; S10a governs how a refused
101
+ * pending requester advances instead). The page includes the first
102
+ * transition whose post-state drops the requester from `members`, then
103
+ * stops; a requester who is not a member at that snapshot is refused.
104
+ * `hasMore` signals a page cut for size, resumable from the last served
105
+ * version.
102
106
  */
103
- getGroupChanges(groupId: Uint8Array, fromVersion: number, authorization: GroupAuthorization): Promise<GroupChangeLogEntry[]>;
107
+ getGroupChanges(groupId: Uint8Array, fromVersion: number, authorization: GroupAuthorization): Promise<GroupChangeLogPage>;
104
108
  /** Submit a group change (optimistic concurrency). */
105
109
  submitGroupChange(groupId: Uint8Array, expectedVersion: number, actions: Uint8Array, inviteLinkPassword: Uint8Array, authorization: GroupAuthorization): Promise<GroupChangeLogEntry>;
106
110
  }
@@ -118,6 +122,19 @@ export interface GroupChangeLogEntry {
118
122
  changeEpoch: number;
119
123
  timestamp: number;
120
124
  }
125
+ /**
126
+ * One page of the change log.
127
+ *
128
+ * The log is served in bounded pages so one request cannot be made to carry
129
+ * a group's whole history. `hasMore` is true only when the server stopped
130
+ * for size with the requester still readable — the client resumes from the
131
+ * version of the last entry served. A walk that ends at the log's tip, or
132
+ * at the transition that revokes the requester, is complete and says so.
133
+ */
134
+ export interface GroupChangeLogPage {
135
+ entries: GroupChangeLogEntry[];
136
+ hasMore: boolean;
137
+ }
121
138
  /**
122
139
  * Callback to rotate sender keys when membership changes.
123
140
  *
@@ -452,6 +469,8 @@ export declare class GroupManager {
452
469
  * presentation, malformed request) is not an access answer at all.
453
470
  */
454
471
  private static isNotReadableRejection;
472
+ /** The FORBIDDEN reason a server rejection carries, if any. */
473
+ private static forbiddenReason;
455
474
  /** Whether this client's verified local span still carries full-state read access. */
456
475
  private isReadableBySelf;
457
476
  /** Verify the S14 commitment before parsing or installing a snapshot. */
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../internal/groups/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAYf,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,KAAK,cAAc,EAMnB,KAAK,oBAAoB,EAyBzB,KAAK,aAAa,EAClB,UAAU,EAKX,MAAM,SAAS,CAAC;AAwCjB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIlD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAUlF,OAAO,EACL,2BAA2B,EAE5B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAmB7D;;;;;GAKG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,YAAY,EAAE,UAAU,C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;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAIrC,+DAA+D;IAC/D,OAAO,CAAC,MAAM,CAAC,eAAe;IAQ9B,sFAAsF;IACtF,OAAO,CAAC,gBAAgB;IAiBxB,yEAAyE;IACzE,OAAO,CAAC,uBAAuB;IAsB/B,mEAAmE;IACnE,OAAO,CAAC,uBAAuB;IAqC/B;;OAEG;YACW,eAAe;IAS7B;;;;;;OAMG;YACW,YAAY;IA6E1B;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IA+ClC;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CAehC;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,oBAAoB,EAC5B,YAAY,EAAE,iBAAiB,EAC/B,0BAA0B,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,GACpE,UAAU,CAuCZ;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,UAAU,EACjB,YAAY,EAAE,iBAAiB,GAC9B,oBAAoB,CAEtB"}
@@ -468,11 +468,23 @@ export class GroupManager {
468
468
  }
469
469
  // Once a member has a baseline it may advance only through
470
470
  // individually verified transitions. A full snapshot must never bypass
471
- // a bad or missing log entry (C1/C3).
472
- const changes = await this.withAuthRetry(rawId, (auth) => this.server.getGroupChanges(secretParams.groupId, currentRevision, auth));
471
+ // a bad or missing log entry (C1/C3). The log arrives in pages; each
472
+ // page resumes from the last verified revision, so an aborted sync
473
+ // resumes exactly where the applied prefix ends.
473
474
  let state = cached;
474
- for (const entry of changes) {
475
- state = await this.applyVerifiedChange(rawId, state, entry);
475
+ for (;;) {
476
+ const page = await this.withAuthRetry(rawId, (auth) => this.server.getGroupChanges(secretParams.groupId, state.revision, auth));
477
+ for (const entry of page.entries) {
478
+ state = await this.applyVerifiedChange(rawId, state, entry);
479
+ }
480
+ if (!page.hasMore)
481
+ break;
482
+ // hasMore with an empty page is a server that claims progress it
483
+ // did not make; looping on it would spin forever, and breaking
484
+ // would report a stale state as current.
485
+ if (page.entries.length === 0) {
486
+ throw new Error('INVALID_CHANGE_SEQUENCE: Server reported more changes but served none');
487
+ }
476
488
  }
477
489
  if (!this.isReadableBySelf(state)) {
478
490
  let baseline = null;
@@ -1240,12 +1252,18 @@ export class GroupManager {
1240
1252
  fullResult = await this.withAuthRetry(groupIdHex, (auth) => this.server.getGroup(secretParams.groupId, auth, entry.version));
1241
1253
  }
1242
1254
  catch (error) {
1243
- // Only the not-readable rejection is revocation. This is a *versioned*
1244
- // read, so the same 403 code can also carry the join-version floor —
1245
- // a rejection about one historical version, raised while the
1246
- // membership itself is fine — and translating that into
1247
- // GROUP_ACCESS_REVOKED would report a live member as removed.
1248
- if (!GroupManager.isNotReadableRejection(error))
1255
+ // This is a *versioned* read, so a 403 can carry three answers.
1256
+ // `not_readable` is revocation outright. `not_a_member` means the
1257
+ // membership the accepted self-add just established is already gone —
1258
+ // the requester is at most pending again, so the join was revoked
1259
+ // between acceptance and this read. `before_join` is the one benign
1260
+ // 403 here: the engine raises it only for a requester holding a live
1261
+ // tenure whose floor sits above the requested version, and
1262
+ // translating that into GROUP_ACCESS_REVOKED would report a live
1263
+ // member as removed — so it, like every unreasoned rejection,
1264
+ // propagates untranslated.
1265
+ const reason = GroupManager.forbiddenReason(error);
1266
+ if (reason !== 'not_readable' && reason !== 'not_a_member')
1249
1267
  throw error;
1250
1268
  // The join was accepted and signed, then revoked before this read: the
1251
1269
  // server authorizes reads at the current state, and the current state
@@ -1282,10 +1300,14 @@ export class GroupManager {
1282
1300
  * presentation, malformed request) is not an access answer at all.
1283
1301
  */
1284
1302
  static isNotReadableRejection(error) {
1303
+ return GroupManager.forbiddenReason(error) === 'not_readable';
1304
+ }
1305
+ /** The FORBIDDEN reason a server rejection carries, if any. */
1306
+ static forbiddenReason(error) {
1285
1307
  const data = error != null && typeof error === 'object' && 'data' in error
1286
1308
  ? error.data
1287
1309
  : undefined;
1288
- return data?.code === 'FORBIDDEN' && data?.reason === 'not_readable';
1310
+ return data?.code === 'FORBIDDEN' ? data.reason : undefined;
1289
1311
  }
1290
1312
  /** Whether this client's verified local span still carries full-state read access. */
1291
1313
  isReadableBySelf(state) {