@goliapkg/sentori-react-native 0.7.1 → 0.7.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../src/handlers/promise.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,qBAAqB,QAAO,IAwBxC,CAAC"}
1
+ {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../src/handlers/promise.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,qBAAqB,QAAO,IA0BxC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { coerceError } from '@goliapkg/sentori-core';
1
2
  import { captureError } from '../capture';
2
3
  let _installed = false;
3
4
  export const installPromiseHandler = () => {
@@ -11,8 +12,11 @@ export const installPromiseHandler = () => {
11
12
  allRejections: true,
12
13
  onUnhandled: (_id, rejection) => {
13
14
  try {
14
- const err = rejection instanceof Error ? rejection : new Error(String(rejection));
15
- captureError(err);
15
+ // `coerceError` keeps the actual rejection visible. JS code
16
+ // routinely rejects with plain objects (`Promise.reject({code})`),
17
+ // which would otherwise collapse to the literal text
18
+ // `[object Object]` in the dashboard.
19
+ captureError(coerceError(rejection));
16
20
  }
17
21
  catch {
18
22
  // never throw
@@ -1 +1 @@
1
- {"version":3,"file":"promise.js","sourceRoot":"","sources":["../../src/handlers/promise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW1C,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAS,EAAE;IAC9C,IAAI,UAAU;QAAE,OAAO;IAEvB,MAAM,MAAM,GAAI,UAAsD;SACnE,cAAc,CAAC;IAClB,IAAI,MAAM,EAAE,6BAA6B,EAAE,CAAC;QAC1C,UAAU,GAAG,IAAI,CAAC;QAClB,MAAM,CAAC,6BAA6B,CAAC;YACnC,aAAa,EAAE,IAA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 +1 @@
1
- {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/handlers/screenshot.ts"],"names":[],"mappings":"AAsDA,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAkDxE"}
1
+ {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/handlers/screenshot.ts"],"names":[],"mappings":"AA6DA,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAmDxE"}
@@ -2,13 +2,10 @@
2
2
  // on `captureException`. Off-main-thread, best-effort, opt-in.
3
3
  //
4
4
  // Performance contract (sub-D.04):
5
- // - Wait for the in-flight RN interaction batch to drain before
6
- // touching the view shot (`InteractionManager.runAfterInteractions`)
7
- // so we never extend the active gesture / animation by a frame.
8
- // - Yield one paint by chaining a `requestAnimationFrame` so the
9
- // screenshot reflects post-error UI state, not the frame that
10
- // was already half-laid-out.
11
- // - Capped output: 480 px on the longest edge, WebP q=70. Typical
5
+ // - Yield one paint via `requestAnimationFrame` before snapshotting
6
+ // so the screenshot reflects post-error UI state, not the frame
7
+ // that was already half-laid-out.
8
+ // - Capped output: 480 px on the longest edge, JPEG q=70. Typical
12
9
  // payload 30-80 KB; multipart hard cap is 500 KB.
13
10
  // - On any failure we silently return null. The error event still
14
11
  // goes to the server; the user just doesn't see a thumbnail.
@@ -17,7 +14,18 @@
17
14
  // lazily so apps that don't install it never pay the bundle cost
18
15
  // or fail at import time. Without it, `captureScreenshot()` returns
19
16
  // `null` immediately.
20
- import { InteractionManager } from 'react-native';
17
+ //
18
+ // 2026-05-15 — dropped `InteractionManager.runAfterInteractions`.
19
+ // RN's docs mark `InteractionManager` as deprecated and recommend
20
+ // `requestIdleCallback`, but `requestIdleCallback` doesn't actually
21
+ // exist in RN (it's a web API), so the deprecation print is
22
+ // unactionable for SDK consumers. The defensive "wait for the active
23
+ // gesture batch to drain" semantics it provided is not reachable
24
+ // from a screenshot triggered on captureException — by the time an
25
+ // error fires, the user is between actions, not mid-gesture — so
26
+ // removing it has no observable effect except silencing the warning.
27
+ // The `requestAnimationFrame` calls below still guarantee one paint
28
+ // commit before captureRef snapshots.
21
29
  import { engageMasks } from '../mask';
22
30
  function loadCaptureRef() {
23
31
  try {
@@ -41,12 +49,13 @@ export async function captureScreenshot() {
41
49
  const captureRef = loadCaptureRef();
42
50
  if (!captureRef)
43
51
  return null;
44
- // Wait for the in-flight RN interaction batch to drain. This is
45
- // why screenshot capture doesn't visibly stall the user's last
46
- // action we let React commit before we ask the OS to render.
47
- await new Promise((resolve) => {
48
- InteractionManager.runAfterInteractions(() => resolve());
49
- });
52
+ // Yield one paint frame so the post-error UI has committed before
53
+ // we ask the OS to snapshot it. The previous
54
+ // `InteractionManager.runAfterInteractions` step was removed: see
55
+ // file header — its replacement (`requestIdleCallback`) doesn't
56
+ // exist in RN, and on captureException the user is between actions
57
+ // anyway, so the gesture-batch-drain semantics never came into
58
+ // play in practice.
50
59
  await new Promise((resolve) => {
51
60
  requestAnimationFrame(() => resolve());
52
61
  });
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../src/handlers/screenshot.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,+DAA+D;AAC/D,EAAE;AACF,mCAAmC;AACnC,kEAAkE;AAClE,yEAAyE;AACzE,oEAAoE;AACpE,mEAAmE;AACnE,kEAAkE;AAClE,iCAAiC;AACjC,oEAAoE;AACpE,sDAAsD;AACtD,oEAAoE;AACpE,iEAAiE;AACjE,EAAE;AACF,kEAAk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;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goliapkg/sentori-react-native",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Sentori SDK for React Native \u2014 JS-layer error capture, native crash handlers (iOS / Android), batched transport, fetch + react-navigation tracing.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://sentori.golia.jp",
@@ -69,6 +69,6 @@
69
69
  "access": "public"
70
70
  },
71
71
  "dependencies": {
72
- "@goliapkg/sentori-core": "0.6.0"
72
+ "@goliapkg/sentori-core": "0.7.0"
73
73
  }
74
74
  }
@@ -1,3 +1,5 @@
1
+ import { coerceError } from '@goliapkg/sentori-core';
2
+
1
3
  import { captureError } from '../capture';
2
4
 
3
5
  type RejectionTracker = (opts: {
@@ -22,9 +24,11 @@ export const installPromiseHandler = (): void => {
22
24
  allRejections: true,
23
25
  onUnhandled: (_id, rejection) => {
24
26
  try {
25
- const err =
26
- rejection instanceof Error ? rejection : new Error(String(rejection));
27
- captureError(err);
27
+ // `coerceError` keeps the actual rejection visible. JS code
28
+ // routinely rejects with plain objects (`Promise.reject({code})`),
29
+ // which would otherwise collapse to the literal text
30
+ // `[object Object]` in the dashboard.
31
+ captureError(coerceError(rejection));
28
32
  } catch {
29
33
  // never throw
30
34
  }
@@ -2,13 +2,10 @@
2
2
  // on `captureException`. Off-main-thread, best-effort, opt-in.
3
3
  //
4
4
  // Performance contract (sub-D.04):
5
- // - Wait for the in-flight RN interaction batch to drain before
6
- // touching the view shot (`InteractionManager.runAfterInteractions`)
7
- // so we never extend the active gesture / animation by a frame.
8
- // - Yield one paint by chaining a `requestAnimationFrame` so the
9
- // screenshot reflects post-error UI state, not the frame that
10
- // was already half-laid-out.
11
- // - Capped output: 480 px on the longest edge, WebP q=70. Typical
5
+ // - Yield one paint via `requestAnimationFrame` before snapshotting
6
+ // so the screenshot reflects post-error UI state, not the frame
7
+ // that was already half-laid-out.
8
+ // - Capped output: 480 px on the longest edge, JPEG q=70. Typical
12
9
  // payload 30-80 KB; multipart hard cap is 500 KB.
13
10
  // - On any failure we silently return null. The error event still
14
11
  // goes to the server; the user just doesn't see a thumbnail.
@@ -17,8 +14,18 @@
17
14
  // lazily so apps that don't install it never pay the bundle cost
18
15
  // or fail at import time. Without it, `captureScreenshot()` returns
19
16
  // `null` immediately.
20
-
21
- import { InteractionManager } from 'react-native';
17
+ //
18
+ // 2026-05-15 dropped `InteractionManager.runAfterInteractions`.
19
+ // RN's docs mark `InteractionManager` as deprecated and recommend
20
+ // `requestIdleCallback`, but `requestIdleCallback` doesn't actually
21
+ // exist in RN (it's a web API), so the deprecation print is
22
+ // unactionable for SDK consumers. The defensive "wait for the active
23
+ // gesture batch to drain" semantics it provided is not reachable
24
+ // from a screenshot triggered on captureException — by the time an
25
+ // error fires, the user is between actions, not mid-gesture — so
26
+ // removing it has no observable effect except silencing the warning.
27
+ // The `requestAnimationFrame` calls below still guarantee one paint
28
+ // commit before captureRef snapshots.
22
29
 
23
30
  import { engageMasks } from '../mask';
24
31
 
@@ -67,12 +74,13 @@ export async function captureScreenshot(): Promise<ScreenshotBlob | null> {
67
74
  const captureRef = loadCaptureRef();
68
75
  if (!captureRef) return null;
69
76
 
70
- // Wait for the in-flight RN interaction batch to drain. This is
71
- // why screenshot capture doesn't visibly stall the user's last
72
- // action we let React commit before we ask the OS to render.
73
- await new Promise<void>((resolve) => {
74
- InteractionManager.runAfterInteractions(() => resolve());
75
- });
77
+ // Yield one paint frame so the post-error UI has committed before
78
+ // we ask the OS to snapshot it. The previous
79
+ // `InteractionManager.runAfterInteractions` step was removed: see
80
+ // file header — its replacement (`requestIdleCallback`) doesn't
81
+ // exist in RN, and on captureException the user is between actions
82
+ // anyway, so the gesture-batch-drain semantics never came into
83
+ // play in practice.
76
84
  await new Promise<void>((resolve) => {
77
85
  requestAnimationFrame(() => resolve());
78
86
  });