ping-openmls-sdk-react-native-macos 0.7.16 → 0.8.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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ping-openmls-sdk-react-native-macos",
3
- "version": "0.7.16",
3
+ "version": "0.8.0",
4
4
  "description": "Real MLS for React Native macOS apps — wraps the ping-openmls-sdk Rust core via UniFFI.",
5
5
  "homepage": "https://github.com/AMP-Media-Development/ping-openmls-sdk",
6
6
  "license": "Apache-2.0",
@@ -189,10 +189,25 @@ export class MessagingClient {
189
189
  }
190
190
  } catch (e) {
191
191
  // Expected for foreign Welcomes (other device's KP) or unknown-conv traffic.
192
- // Logged for diagnostic value during stage 5 drop to silent in production.
192
+ // In DEV we log the FULL message + stack: the previous 80-char
193
+ // truncation hid the real cause (e.g. an "Exception in HostFunction"
194
+ // thrown deep inside a storage/observer round-trip during join).
195
+ // In prod we keep the short, low-noise line.
193
196
  const msg = e instanceof Error ? e.message : String(e);
194
- // eslint-disable-next-line no-console
195
- console.log("[ws-subscribe] " + String(kind) + " dropped: " + msg.slice(0, 80));
197
+ const stack = e instanceof Error ? e.stack : undefined;
198
+ const isDev =
199
+ typeof globalThis !== "undefined" &&
200
+ (globalThis as { __DEV__?: boolean }).__DEV__ === true;
201
+ if (isDev) {
202
+ // eslint-disable-next-line no-console
203
+ console.warn(
204
+ "[ws-subscribe] " + String(kind) + " dropped: " + msg +
205
+ (stack ? "\n" + stack : ""),
206
+ );
207
+ } else {
208
+ // eslint-disable-next-line no-console
209
+ console.log("[ws-subscribe] " + String(kind) + " dropped: " + msg.slice(0, 80));
210
+ }
196
211
  }
197
212
  })();
198
213
  });
@@ -43,8 +43,25 @@ export function connectStorageBridge(storage: Storage): () => void {
43
43
  return () => subscription.remove();
44
44
  }
45
45
 
46
+ function isDev(): boolean {
47
+ return (
48
+ typeof globalThis !== "undefined" &&
49
+ (globalThis as { __DEV__?: boolean }).__DEV__ === true
50
+ );
51
+ }
52
+
46
53
  async function handle(event: StorageCallEvent, storage: Storage): Promise<void> {
47
54
  const { id, method, args } = event;
55
+ if (isDev()) {
56
+ // Trace every Rust→JS storage call so a failing round-trip during
57
+ // join/checkpoint is attributable to a specific namespace+key.
58
+ // eslint-disable-next-line no-console
59
+ console.log(
60
+ "[ping-storage] " + method +
61
+ " ns=" + String(args.namespace ?? "") +
62
+ " key=" + String(args.key ?? args.prefix ?? ""),
63
+ );
64
+ }
48
65
  try {
49
66
  let result: unknown;
50
67
  switch (method) {
@@ -74,6 +91,14 @@ async function handle(event: StorageCallEvent, storage: Storage): Promise<void>
74
91
  await NativeModules.PingNative.resolveStorageCall(id, result);
75
92
  } catch (e) {
76
93
  const message = e instanceof Error ? e.message : String(e);
94
+ if (isDev()) {
95
+ // eslint-disable-next-line no-console
96
+ console.warn(
97
+ "[ping-storage] " + method +
98
+ " ns=" + String(args.namespace ?? "") + " FAILED: " + message +
99
+ (e instanceof Error && e.stack ? "\n" + e.stack : ""),
100
+ );
101
+ }
77
102
  try {
78
103
  await NativeModules.PingNative.rejectStorageCall(id, message);
79
104
  } catch {