@logbrew/react-native 0.1.34 → 0.1.36

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 (33) hide show
  1. package/README.md +33 -4
  2. package/android/src/main/java/co/logbrew/reactnative/AndroidDiagnosticsRuntime.java +2 -0
  3. package/android/src/main/java/co/logbrew/reactnative/AndroidNativeDiagnostics.java +56 -2
  4. package/android/src/main/java/co/logbrew/reactnative/EventRecordStore.java +25 -0
  5. package/android/src/main/java/co/logbrew/reactnative/FatalStoreModuleImpl.java +30 -3
  6. package/android/src/newarch/java/co/logbrew/reactnative/FatalStoreModule.java +6 -0
  7. package/android/src/oldarch/java/co/logbrew/reactnative/FatalStoreModule.java +6 -0
  8. package/expo.cjs +1 -1
  9. package/fatal-replay.cjs +97 -110
  10. package/global-errors.cjs +94 -130
  11. package/global-errors.d.cts +23 -3
  12. package/global-errors.d.ts +23 -3
  13. package/index.cjs +47 -20
  14. package/index.d.cts +1 -0
  15. package/index.d.ts +1 -0
  16. package/index.native.js +4 -3
  17. package/instrumentation.cjs +80 -57
  18. package/ios/AppleDiagnostics/LBRNAppleNativeDiagnostics.swift +1 -1
  19. package/ios/GeneratedAppleDiagnostics/LogBrewCrash/NativeCrashCorrelation.swift +2 -0
  20. package/ios/GeneratedAppleDiagnostics/LogBrewCrash/NativeCrashReplay.swift +31 -7
  21. package/ios/GeneratedAppleDiagnostics/SOURCE-MANIFEST.json +2 -2
  22. package/ios/LBRNEventRecordStore.h +1 -0
  23. package/ios/LBRNEventRecordStore.m +43 -0
  24. package/ios/LBRNFatalStoreModule.mm +14 -0
  25. package/metadata.cjs +1 -1
  26. package/native-bridge.cjs +112 -8
  27. package/native-bridge.d.cts +34 -0
  28. package/native-bridge.d.ts +34 -0
  29. package/native-bridge.js +2 -1
  30. package/package.json +1 -1
  31. package/persistent-delivery.native.js +12 -1
  32. package/promise-rejections.cjs +11 -1
  33. package/src/NativeLogBrewFatalStore.ts +4 -0
@@ -122,7 +122,7 @@ export function purgeReactNativePersistentQueue({ apiKey, clientKey } = {}) {
122
122
  }
123
123
 
124
124
  function createNativeEventStore(nativeStore, authKey, release) {
125
- return {
125
+ const eventStore = {
126
126
  load() {
127
127
  const result = requireStatus(
128
128
  "load",
@@ -193,6 +193,15 @@ function createNativeEventStore(nativeStore, authKey, release) {
193
193
  }
194
194
  }
195
195
  };
196
+ // Older native binaries lack removal; the core then drops a fatal at a full queue.
197
+ if (typeof nativeStore.removeEventRecords === "function") {
198
+ eventStore.remove = (indexes) => requireStatus(
199
+ "remove",
200
+ callNative(nativeStore, "removeEventRecords", authKey, indexes),
201
+ "removed"
202
+ );
203
+ }
204
+ return eventStore;
196
205
  }
197
206
 
198
207
  function defaultNativeStore() {
@@ -266,6 +275,8 @@ function methodName(method) {
266
275
  return "append";
267
276
  case "acknowledgeEventRecords":
268
277
  return "acknowledge";
278
+ case "removeEventRecords":
279
+ return "remove";
269
280
  case "purgeEventRecords":
270
281
  return "purge";
271
282
  case "closeEventStore":
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const { createReactNativeErrorEvent } = require("./index.cjs");
4
+ const { captureIssueWithAdmission } = require("./fatal-replay.cjs");
4
5
 
5
6
  const AUTOMATIC_MESSAGE = "Unhandled Promise rejection";
6
7
  const DEFAULT_MAX_TRACKED_REJECTIONS = 128;
@@ -101,7 +102,16 @@ function createPromiseRejectionHandlers(options, mechanism) {
101
102
  emitStateDiagnostic(state, onDiagnostic, "promise_rejection_id_unavailable");
102
103
  }
103
104
  const event = createEvent(mechanism);
104
- issue.call(client, event.id, event.timestamp, event.attributes);
105
+ const admission = captureIssueWithAdmission(client, issue, event.id, event.timestamp, event.attributes);
106
+ if (admission !== "admitted") {
107
+ state.lastOutcome = admission === "unavailable"
108
+ ? "admission_unavailable"
109
+ : admission === "filtered" ? "filtered" : "capture_failed";
110
+ emitStateDiagnostic(state, onDiagnostic, admission === "unavailable"
111
+ ? "promise_rejection_admission_unavailable"
112
+ : admission === "filtered" ? "promise_rejection_filtered" : "promise_rejection_capture_failed");
113
+ return;
114
+ }
105
115
  state.capturedEvents = incrementBounded(state.capturedEvents);
106
116
 
107
117
  if (key === undefined) {
@@ -10,6 +10,10 @@ export interface Spec extends TurboModule {
10
10
  eventBytes: number
11
11
  ): CodegenTypes.UnsafeObject;
12
12
  acknowledgeEventRecords(queueKey: string, count: number): CodegenTypes.UnsafeObject;
13
+ removeEventRecords(
14
+ queueKey: string,
15
+ indexes: ReadonlyArray<number>
16
+ ): CodegenTypes.UnsafeObject;
13
17
  purgeEventRecords(queueKey: string): CodegenTypes.UnsafeObject;
14
18
  closeEventStore(queueKey: string): CodegenTypes.UnsafeObject;
15
19
  installAndroidDiagnostics(