@logbrew/react-native 0.1.25 → 0.1.27

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.
@@ -26,7 +26,7 @@ constexpr size_t kProjectChars = 36;
26
26
  constexpr size_t kReleaseChars = 256;
27
27
  constexpr size_t kEnvironmentChars = 128;
28
28
  constexpr size_t kServiceChars = 128;
29
- constexpr size_t kMaxModules = 192;
29
+ constexpr size_t kMaxModules = 4096;
30
30
  constexpr std::array<int, 6> kSignals = {SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP};
31
31
 
32
32
  #pragma pack(push, 1)
@@ -57,6 +57,7 @@ struct Module {
57
57
 
58
58
  std::array<Module, kMaxModules> g_modules{};
59
59
  size_t g_module_count = 0;
60
+ bool g_module_overflow = false;
60
61
  std::array<struct sigaction, kSignals.size()> g_previous_actions{};
61
62
  std::array<char, 1024> g_record_path{};
62
63
  SignalRecord g_record_template{};
@@ -111,6 +112,7 @@ bool read_build_id(const dl_phdr_info* info, std::array<uint8_t, 16>* output) {
111
112
 
112
113
  int collect_module(dl_phdr_info* info, size_t, void*) {
113
114
  if (g_module_count == g_modules.size()) {
115
+ g_module_overflow = true;
114
116
  return 1;
115
117
  }
116
118
  uintptr_t start = UINTPTR_MAX;
@@ -329,7 +331,12 @@ Java_co_logbrew_reactnative_AndroidDiagnosticsRuntime_nativeInstall(
329
331
  g_record_template.magic = kMagic;
330
332
  g_record_template.version = kVersion;
331
333
  g_module_count = 0;
334
+ g_module_overflow = false;
332
335
  dl_iterate_phdr(collect_module, nullptr);
336
+ if (g_module_overflow) {
337
+ g_installed.store(false);
338
+ return JNI_FALSE;
339
+ }
333
340
  struct sigaction action {};
334
341
  sigemptyset(&action.sa_mask);
335
342
  action.sa_sigaction = signal_handler;
@@ -19,7 +19,6 @@ final class AndroidDiagnosticsRuntime implements Thread.UncaughtExceptionHandler
19
19
  private final AndroidNativeDiagnostics diagnostics;
20
20
  private final Thread.UncaughtExceptionHandler previousHandler;
21
21
  private final AndroidNativeDiagnostics.Configuration configuration;
22
- private final String signalRecordPath;
23
22
 
24
23
  AndroidDiagnosticsRuntime(
25
24
  Context context,
@@ -40,7 +39,6 @@ final class AndroidDiagnosticsRuntime implements Thread.UncaughtExceptionHandler
40
39
  () -> {},
41
40
  this::chain,
42
41
  scheduler.mainThread::getStackTrace);
43
- signalRecordPath = signalStore.path();
44
42
  }
45
43
 
46
44
  synchronized String install() {
@@ -55,7 +53,7 @@ final class AndroidDiagnosticsRuntime implements Thread.UncaughtExceptionHandler
55
53
  if (!diagnostics.signalStore.prepare(new AndroidParentDirectorySync())
56
54
  || !SIGNAL_CAPTURE_AVAILABLE
57
55
  || !nativeInstall(
58
- signalRecordPath,
56
+ diagnostics.signalStore.path(),
59
57
  diagnostics.nextNativeEventId(),
60
58
  configuration.projectId,
61
59
  configuration.release,
@@ -154,7 +152,6 @@ final class AndroidDiagnosticsRuntime implements Thread.UncaughtExceptionHandler
154
152
  thread.setDaemon(true);
155
153
  return thread;
156
154
  });
157
- long intervalMs = Math.max(500, thresholdMs / 2);
158
155
  executor.scheduleWithFixedDelay(
159
156
  () -> {
160
157
  long now = SystemClock.elapsedRealtime();
@@ -169,7 +166,7 @@ final class AndroidDiagnosticsRuntime implements Thread.UncaughtExceptionHandler
169
166
  mainHandler.post(this::heartbeat);
170
167
  },
171
168
  thresholdMs,
172
- intervalMs,
169
+ AndroidNativeDiagnostics.WATCHDOG_POLL_MS,
173
170
  TimeUnit.MILLISECONDS);
174
171
  }
175
172
 
@@ -90,6 +90,7 @@ final class AndroidNativeDiagnostics {
90
90
  }
91
91
 
92
92
  private static final int MAX_FRAMES = 32;
93
+ static final long WATCHDOG_POLL_MS = 500;
93
94
  private static final AtomicLong SEQUENCE = new AtomicLong();
94
95
 
95
96
  final EventRecordStore eventStore;
package/index.cjs CHANGED
@@ -16,7 +16,7 @@ const {
16
16
  } = require("./metadata.cjs");
17
17
 
18
18
  const DEFAULT_SDK_NAME = "logbrew-react-native";
19
- const DEFAULT_SDK_VERSION = "0.1.25";
19
+ const DEFAULT_SDK_VERSION = "0.1.27";
20
20
  const DEFAULT_ENDPOINT = "https://api.logbrew.co/v1/events";
21
21
  const NATIVE_RANDOM_HEX = Symbol.for("co.logbrew.react-native.secure-random-hex");
22
22
  const MAX_ACTION_NAME_LENGTH = 64;
@@ -3,7 +3,7 @@ import Foundation
3
3
  @objc(LBRNAppleNativeDiagnostics)
4
4
  public final class LBRNAppleNativeDiagnostics: NSObject, @unchecked Sendable {
5
5
  private static let shared = LBRNAppleNativeDiagnostics()
6
- private static let sdkVersion = "0.1.25"
6
+ private static let sdkVersion = "0.1.27"
7
7
 
8
8
  private let lock = NSLock()
9
9
  private let replayQueue = DispatchQueue(label: "co.logbrew.react-native.apple-diagnostics-replay")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logbrew/react-native",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "React Native offline delivery, native diagnostics, screen, error, trace, action, and network timeline helpers for LogBrew.",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",