@scalebun/react-native 1.10.2 → 1.10.4
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/android/src/main/java/com/scalebun/rn/crash/ScaleBunCrashModule.kt +24 -0
- package/android/src/oldarch/java/com/scalebun/rn/crash/ScaleBunCrashSpec.kt +3 -0
- package/dist/scalebun.full.js +821 -768
- package/dist/scalebun.full.js.map +1 -1
- package/dist/scalebun.slim.js +835 -782
- package/dist/scalebun.slim.js.map +1 -1
- package/ios/Crash/ScaleBunCrashBridge.mm +5 -0
- package/ios/Crash/ScaleBunCrashModule.swift +15 -0
- package/lib/commonjs/bootstrap/SDKBootstrapper.js +14 -2
- package/lib/commonjs/bootstrap/SDKBootstrapper.js.map +1 -1
- package/lib/commonjs/core/constants/version.js +1 -1
- package/lib/commonjs/features/crash/CrashFeature.js +17 -1
- package/lib/commonjs/features/crash/CrashFeature.js.map +1 -1
- package/lib/commonjs/features/crash/nativeCrashBridge.js +61 -3
- package/lib/commonjs/features/crash/nativeCrashBridge.js.map +1 -1
- package/lib/commonjs/specs/NativeScaleBunCrash.js.map +1 -1
- package/lib/module/bootstrap/SDKBootstrapper.js +13 -0
- package/lib/module/bootstrap/SDKBootstrapper.js.map +1 -1
- package/lib/module/core/constants/version.js +1 -1
- package/lib/module/features/crash/CrashFeature.js +17 -1
- package/lib/module/features/crash/CrashFeature.js.map +1 -1
- package/lib/module/features/crash/nativeCrashBridge.js +60 -3
- package/lib/module/features/crash/nativeCrashBridge.js.map +1 -1
- package/lib/module/specs/NativeScaleBunCrash.js.map +1 -1
- package/lib/typescript/bootstrap/SDKBootstrapper.d.ts.map +1 -1
- package/lib/typescript/core/constants/version.d.ts +1 -1
- package/lib/typescript/features/crash/CrashFeature.d.ts.map +1 -1
- package/lib/typescript/features/crash/nativeCrashBridge.d.ts +24 -0
- package/lib/typescript/features/crash/nativeCrashBridge.d.ts.map +1 -1
- package/lib/typescript/specs/NativeScaleBunCrash.d.ts +11 -0
- package/lib/typescript/specs/NativeScaleBunCrash.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bootstrap/SDKBootstrapper.ts +15 -0
- package/src/core/constants/version.ts +1 -1
- package/src/features/crash/CrashFeature.ts +17 -1
- package/src/features/crash/nativeCrashBridge.ts +69 -3
- package/src/specs/NativeScaleBunCrash.ts +12 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","nativeModuleVia","logger","getCrashReporter","_crashModule","getCrashModule","mod","turbo","require","default","__DEV__","debug","legacy","ScaleBunCrash","setNativeActiveSession","sessionId","setActiveSessionId","installNativeCrashHandler","install","MAX_DRAIN_PER_LAUNCH","drainNativeCrash","found","seen","Set","i","outcome","drainOne","drainPendingCrash","crash","seenKey","crashId","has","add","stackArr","Array","isArray","stackTrace","
|
|
1
|
+
{"version":3,"names":["NativeModules","nativeModuleVia","logger","getCrashReporter","_crashModule","getCrashModule","mod","turbo","require","default","__DEV__","debug","legacy","ScaleBunCrash","setNativeActiveSession","sessionId","setActiveSessionId","installNativeCrashHandler","install","MAX_DRAIN_PER_LAUNCH","drainNativeCrash","found","seen","Set","i","outcome","drainOne","drainPendingCrash","crash","seenKey","crashId","has","add","stackArr","Array","isArray","stackTrace","recordType","type","recordSource","source","report","isFatal","message","exceptionType","stack","length","join","String","undefined","screenName","platform","metadata","threadName","signal","clearPendingCrash","info","delivered","confirmDelivery","SessionManager","transport","getExistingInstance","getBackendTransport","flushErrors","triggerNativeCrash","crashNow","warn","persistFatalJsCrash","input","persistJsCrash","nowMs","counter","record","timestamp","Date","toISOString","JSON","stringify","_seq","now"],"sourceRoot":"../../../../src","sources":["features/crash/nativeCrashBridge.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,MAAM,QAAQ,kCAAkC;AACzD,SAASC,gBAAgB,QAAQ,iBAAiB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA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CAAC;IACtC,CAAC;IACD,OAAOrE,GAAG,CAAC+D,cAAc,CAACO,IAAI,CAACC,SAAS,CAACL,MAAM,CAAC,CAAC,KAAK,IAAI;EAC9D,CAAC,CAAC,MAAM;IACJ,OAAO,KAAK;EAChB;AACJ;;AAEA;AACA,IAAIM,IAAI,GAAG,CAAC;AACZ,SAASP,OAAOA,CAAA,EAAW;EACvBO,IAAI,GAAG,CAACA,IAAI,GAAG,CAAC,IAAI,SAAS;EAC7B,OAAOA,IAAI;AACf;AACA,SAASR,KAAKA,CAAA,EAAW;EACrB,OAAOI,IAAI,CAACK,GAAG,CAAC,CAAC;AACrB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeScaleBunCrash.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeScaleBunCrash.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,eAAe,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SDKBootstrapper.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/SDKBootstrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAW1E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAepD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,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AC,UAAU,CAAwC;IAC1D,OAAO,CAAC,oBAAoB,CAA6B;IAEzD;;;;;;;;;;OAUG;IACG,SAAS,CACX,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAClE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,QAAQ,GAAE,gBAAqB,GAChC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IA+dlC;;;;OAIG;IACH;;;;;;;OAOG;IACH,OAAO,CAAC,0BAA0B;IAwBlC;;;;;;OAMG;IACH,OAAO,CAAC,4BAA4B;IAapC,OAAO,CAAC,sBAAsB;IAU9B,+BAA+B;IAC/B,SAAS,IAAI,cAAc,GAAG,IAAI;IAIlC,6BAA6B;IAC7B,QAAQ,IAAI,IAAI;CAOnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrashFeature.d.ts","sourceRoot":"","sources":["../../../../src/features/crash/CrashFeature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"CrashFeature.d.ts","sourceRoot":"","sources":["../../../../src/features/crash/CrashFeature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAO9E,qBAAa,YAAa,YAAW,QAAQ;IACzC,QAAQ,CAAC,IAAI,WAAW;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAsB;gBAEzB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAIxC,UAAU,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAmD1C,QAAQ,IAAI,IAAI;IAKhB,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACJ"}
|
|
@@ -29,4 +29,28 @@ export declare function drainNativeCrash(): Promise<boolean>;
|
|
|
29
29
|
* No-op when the native module or `crashNow` is unavailable.
|
|
30
30
|
*/
|
|
31
31
|
export declare function triggerNativeCrash(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Persist a FATAL JS crash to disk BEFORE the process dies.
|
|
34
|
+
*
|
|
35
|
+
* A fatal JS error tears the process down almost immediately. The normal error
|
|
36
|
+
* path queues the crash and POSTs it asynchronously, which loses the race: the
|
|
37
|
+
* process is gone before the request finishes, and nothing is on disk to retry.
|
|
38
|
+
* This is why a JS crash could vanish while a native one always survived.
|
|
39
|
+
*
|
|
40
|
+
* The fix is the native module's SYNCHRONOUS persistJsCrash: it writes the
|
|
41
|
+
* record to the same store native crashes use and returns before this function
|
|
42
|
+
* returns — so by the time the JS handler unwinds, the crash is durable. The
|
|
43
|
+
* existing drain path then delivers it on the next launch, at least once,
|
|
44
|
+
* deduped on crashId.
|
|
45
|
+
*
|
|
46
|
+
* Synchronous and no-throw by construction: this runs inside the global error
|
|
47
|
+
* handler, where an exception would replace one crash with another.
|
|
48
|
+
*/
|
|
49
|
+
export declare function persistFatalJsCrash(input: {
|
|
50
|
+
message: string;
|
|
51
|
+
stack?: string;
|
|
52
|
+
screenName?: string;
|
|
53
|
+
platform?: string;
|
|
54
|
+
sessionId?: string;
|
|
55
|
+
}): boolean;
|
|
32
56
|
//# sourceMappingURL=nativeCrashBridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeCrashBridge.d.ts","sourceRoot":"","sources":["../../../../src/features/crash/nativeCrashBridge.ts"],"names":[],"mappings":"AAwCA;;;;GAIG;AACH;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS7E;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAY/D;AAgBD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAYzD;
|
|
1
|
+
{"version":3,"file":"nativeCrashBridge.d.ts","sourceRoot":"","sources":["../../../../src/features/crash/nativeCrashBridge.ts"],"names":[],"mappings":"AAwCA;;;;GAIG;AACH;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS7E;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAY/D;AAgBD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAYzD;AAgJD;;;;GAIG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAWxD;AACD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAuBV"}
|
|
@@ -35,6 +35,17 @@ export interface Spec extends TurboModule {
|
|
|
35
35
|
* can be the moment of deletion — a failed upload must leave the durable copy in place.
|
|
36
36
|
*/
|
|
37
37
|
clearPendingCrash(crashId: string): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Persist a FATAL JS crash to the same on-disk store native crashes use, so
|
|
40
|
+
* the next launch drains it. SYNCHRONOUS by design (returns a boolean, not a
|
|
41
|
+
* Promise): a fatal JS error tears the process down, and an async POST — or
|
|
42
|
+
* even an async native call — races that teardown and loses the crash. A
|
|
43
|
+
* blocking write completes on disk before the JS handler returns.
|
|
44
|
+
*
|
|
45
|
+
* recordJson is a JSON crash record: at least { crashId, type, message },
|
|
46
|
+
* plus stack / screenName / platform / sessionId / timestamp when known.
|
|
47
|
+
*/
|
|
48
|
+
persistJsCrash(recordJson: string): boolean;
|
|
38
49
|
}
|
|
39
50
|
/**
|
|
40
51
|
* Resolved via `get` (not `getEnforcing`) so the SDK degrades gracefully when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeScaleBunCrash.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeScaleBunCrash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,0EAA0E;IAC1E,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5B,wEAAwE;IACxE,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7B;;;;;OAKG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAExD,uEAAuE;IACvE,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAErC;;;;;OAKG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeScaleBunCrash.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeScaleBunCrash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,0EAA0E;IAC1E,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5B,wEAAwE;IACxE,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7B;;;;;OAKG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAExD,uEAAuE;IACvE,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAErC;;;;;OAKG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErD;;;;;;;;;OASG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7C;AAED;;;;;GAKG;;AACH,wBAA8D"}
|
package/package.json
CHANGED
|
@@ -382,6 +382,21 @@ export class SDKBootstrapper {
|
|
|
382
382
|
});
|
|
383
383
|
sessionManager.setBackendTransport(backendAdapter);
|
|
384
384
|
|
|
385
|
+
// Re-drain recovered crashes now that a backend transport exists.
|
|
386
|
+
//
|
|
387
|
+
// drainNativeCrash already ran inside initializeAll — BEFORE this line — so a
|
|
388
|
+
// crash recovered from the previous run was reported into a NULL transport, the
|
|
389
|
+
// backend sink no-op'd, and the record was KEPT on disk. Next launch loses the
|
|
390
|
+
// identical race, so without this a recovered crash (JS or native) never reaches
|
|
391
|
+
// the dashboard. The record is durable (the persist fix), so re-draining here
|
|
392
|
+
// delivers it THIS launch; the adapter buffers the error until the session row
|
|
393
|
+
// exists, so it lands even though startSession may not have completed yet. A
|
|
394
|
+
// no-op when nothing is pending. Fire-and-forget — crash delivery must never
|
|
395
|
+
// block or fail session setup.
|
|
396
|
+
import('../features/crash/nativeCrashBridge')
|
|
397
|
+
.then((m) => m.drainNativeCrash())
|
|
398
|
+
.catch(() => {});
|
|
399
|
+
|
|
385
400
|
// Opt-in console → Logs lane. Armed here (not only in the desktop-debug
|
|
386
401
|
// replay orchestrator) so a stock SaaS app can capture console.* without
|
|
387
402
|
// pulling in the devTools bundle. Gated by clientKey (the backend transport
|
|
@@ -13,6 +13,8 @@ import type { IFeature, FeatureContext } from '../../core/contracts/IFeature';
|
|
|
13
13
|
import { installCrashReporting } from './index';
|
|
14
14
|
import { installRejectionHandler } from './rejectionHandler';
|
|
15
15
|
import { getCrashReporter } from './CrashReporter';
|
|
16
|
+
import { persistFatalJsCrash } from './nativeCrashBridge';
|
|
17
|
+
import { Platform } from 'react-native';
|
|
16
18
|
|
|
17
19
|
export class CrashFeature implements IFeature {
|
|
18
20
|
readonly name = 'crash';
|
|
@@ -35,7 +37,21 @@ export class CrashFeature implements IFeature {
|
|
|
35
37
|
});
|
|
36
38
|
|
|
37
39
|
if (isFatal) {
|
|
38
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Persist to disk FIRST, synchronously, before anything else.
|
|
42
|
+
*
|
|
43
|
+
* A fatal JS crash tears the process down before an async POST
|
|
44
|
+
* can finish, so the report queued above can be lost. The native
|
|
45
|
+
* write below completes on disk before this handler returns, and
|
|
46
|
+
* the next launch drains and delivers it — the same guarantee
|
|
47
|
+
* native crashes already had, now extended to JS.
|
|
48
|
+
*/
|
|
49
|
+
persistFatalJsCrash({
|
|
50
|
+
message: error.message,
|
|
51
|
+
stack: error.stack,
|
|
52
|
+
platform: Platform.OS,
|
|
53
|
+
});
|
|
54
|
+
// Best-effort live delivery too, in case the process lingers.
|
|
39
55
|
this.flushFn();
|
|
40
56
|
}
|
|
41
57
|
});
|
|
@@ -145,12 +145,20 @@ async function drainOne(seen: Set<string>): Promise<'none' | 'cleared' | 'kept'>
|
|
|
145
145
|
// 2) SaaS backend errors endpoint (dashboard Crashes view) — route the
|
|
146
146
|
// same normalized report through the central reporter. This is what
|
|
147
147
|
// makes native crashes visible in the dashboard, not just the desktop.
|
|
148
|
+
const recordType = typeof crash.type === 'string' ? crash.type : 'native';
|
|
149
|
+
const recordSource = typeof crash.source === 'string' ? crash.source : 'native';
|
|
148
150
|
getCrashReporter().report({
|
|
149
|
-
source:
|
|
150
|
-
type:
|
|
151
|
+
source: recordSource,
|
|
152
|
+
type: recordType,
|
|
151
153
|
isFatal: true,
|
|
152
154
|
message: crash.message ?? crash.exceptionType ?? 'Native crash',
|
|
153
|
-
stack: stackArr.length
|
|
155
|
+
stack: stackArr.length
|
|
156
|
+
? stackArr.join('\n')
|
|
157
|
+
: crash.stack
|
|
158
|
+
? String(crash.stack)
|
|
159
|
+
: undefined,
|
|
160
|
+
// Set for a recovered JS crash; a native crash has no JS screen.
|
|
161
|
+
...(crash.screenName ? { screenName: String(crash.screenName) } : {}),
|
|
154
162
|
platform: crash.platform,
|
|
155
163
|
/**
|
|
156
164
|
* THE ORIGINAL SESSION — the entire point of the recovery path.
|
|
@@ -264,3 +272,61 @@ export async function triggerNativeCrash(): Promise<void> {
|
|
|
264
272
|
// The process is expected to die; nothing to handle.
|
|
265
273
|
}
|
|
266
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Persist a FATAL JS crash to disk BEFORE the process dies.
|
|
277
|
+
*
|
|
278
|
+
* A fatal JS error tears the process down almost immediately. The normal error
|
|
279
|
+
* path queues the crash and POSTs it asynchronously, which loses the race: the
|
|
280
|
+
* process is gone before the request finishes, and nothing is on disk to retry.
|
|
281
|
+
* This is why a JS crash could vanish while a native one always survived.
|
|
282
|
+
*
|
|
283
|
+
* The fix is the native module's SYNCHRONOUS persistJsCrash: it writes the
|
|
284
|
+
* record to the same store native crashes use and returns before this function
|
|
285
|
+
* returns — so by the time the JS handler unwinds, the crash is durable. The
|
|
286
|
+
* existing drain path then delivers it on the next launch, at least once,
|
|
287
|
+
* deduped on crashId.
|
|
288
|
+
*
|
|
289
|
+
* Synchronous and no-throw by construction: this runs inside the global error
|
|
290
|
+
* handler, where an exception would replace one crash with another.
|
|
291
|
+
*/
|
|
292
|
+
export function persistFatalJsCrash(input: {
|
|
293
|
+
message: string;
|
|
294
|
+
stack?: string;
|
|
295
|
+
screenName?: string;
|
|
296
|
+
platform?: string;
|
|
297
|
+
sessionId?: string;
|
|
298
|
+
}): boolean {
|
|
299
|
+
try {
|
|
300
|
+
const mod = getCrashModule();
|
|
301
|
+
if (!mod?.persistJsCrash) return false;
|
|
302
|
+
// Minted once, here, so a retry from disk dedupes on the backend rather
|
|
303
|
+
// than arriving as a fresh crash every launch.
|
|
304
|
+
const crashId = `jscrash-${nowMs()}-${counter()}`;
|
|
305
|
+
const record = {
|
|
306
|
+
crashId,
|
|
307
|
+
type: 'crash',
|
|
308
|
+
source: 'js',
|
|
309
|
+
isFatal: true,
|
|
310
|
+
message: input.message,
|
|
311
|
+
stack: input.stack,
|
|
312
|
+
screenName: input.screenName,
|
|
313
|
+
platform: input.platform,
|
|
314
|
+
sessionId: input.sessionId,
|
|
315
|
+
timestamp: new Date().toISOString(),
|
|
316
|
+
};
|
|
317
|
+
return mod.persistJsCrash(JSON.stringify(record)) === true;
|
|
318
|
+
} catch {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** Monotonic-ish parts for a unique id without pulling in a uuid dependency. */
|
|
324
|
+
let _seq = 0;
|
|
325
|
+
function counter(): number {
|
|
326
|
+
_seq = (_seq + 1) % 1_000_000;
|
|
327
|
+
return _seq;
|
|
328
|
+
}
|
|
329
|
+
function nowMs(): number {
|
|
330
|
+
return Date.now();
|
|
331
|
+
}
|
|
332
|
+
|
|
@@ -41,6 +41,18 @@ export interface Spec extends TurboModule {
|
|
|
41
41
|
* can be the moment of deletion — a failed upload must leave the durable copy in place.
|
|
42
42
|
*/
|
|
43
43
|
clearPendingCrash(crashId: string): Promise<boolean>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Persist a FATAL JS crash to the same on-disk store native crashes use, so
|
|
47
|
+
* the next launch drains it. SYNCHRONOUS by design (returns a boolean, not a
|
|
48
|
+
* Promise): a fatal JS error tears the process down, and an async POST — or
|
|
49
|
+
* even an async native call — races that teardown and loses the crash. A
|
|
50
|
+
* blocking write completes on disk before the JS handler returns.
|
|
51
|
+
*
|
|
52
|
+
* recordJson is a JSON crash record: at least { crashId, type, message },
|
|
53
|
+
* plus stack / screenName / platform / sessionId / timestamp when known.
|
|
54
|
+
*/
|
|
55
|
+
persistJsCrash(recordJson: string): boolean;
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
/**
|