@bugsee/react-native 0.0.0-stage → 7.0.0-beta2
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/BugseeReactNative.podspec +95 -0
- package/LICENSE +21 -0
- package/README.md +557 -2
- package/android/build.gradle +162 -0
- package/android/consumer-rules.pro +2 -0
- package/android/src/main/AndroidManifest.xml +33 -0
- package/android/src/main/java/com/bugsee/reactnative/AppearanceBridge.java +82 -0
- package/android/src/main/java/com/bugsee/reactnative/AttributeBridge.java +209 -0
- package/android/src/main/java/com/bugsee/reactnative/BreadcrumbFilterBridge.java +443 -0
- package/android/src/main/java/com/bugsee/reactnative/BridgeJson.java +168 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeModule.java +1869 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeOptionEnums.java +136 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseePackage.java +42 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeReactNativeWrapper.java +200 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeStatusMapper.java +66 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeTokens.java +22 -0
- package/android/src/main/java/com/bugsee/reactnative/ConsoleEchoDedup.java +202 -0
- package/android/src/main/java/com/bugsee/reactnative/CreatedReports.java +127 -0
- package/android/src/main/java/com/bugsee/reactnative/DataRequestBridge.java +375 -0
- package/android/src/main/java/com/bugsee/reactnative/ExceptionBridge.java +88 -0
- package/android/src/main/java/com/bugsee/reactnative/ExceptionExecutors.java +33 -0
- package/android/src/main/java/com/bugsee/reactnative/LogFilterBridge.java +375 -0
- package/android/src/main/java/com/bugsee/reactnative/NetworkEvents.java +227 -0
- package/android/src/main/java/com/bugsee/reactnative/NetworkFilterBridge.java +498 -0
- package/android/src/main/java/com/bugsee/reactnative/PluginEndpoint.java +48 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactNativeWebException.java +19 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactNativeWrapperInitProvider.java +61 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactRootOriginTracker.java +867 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportArgs.java +58 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportHandlerBridge.java +336 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportHandlerDeadlines.java +57 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportOps.java +287 -0
- package/android/src/main/java/com/bugsee/reactnative/SecureRectanglePulls.java +113 -0
- package/android/src/main/java/com/bugsee/reactnative/SecureRectangleStore.java +692 -0
- package/android/src/main/java/com/bugsee/reactnative/SpanHandles.java +143 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperChannelHolder.java +137 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperEventBus.java +110 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperRegistrar.java +54 -0
- package/app.plugin.js +4 -0
- package/ios/BGSRNConsoleCapture.h +52 -0
- package/ios/BGSRNConsoleCapture.mm +344 -0
- package/ios/BugseeModule.h +25 -0
- package/ios/BugseeModule.mm +2728 -0
- package/ios/Package.swift +71 -0
- package/ios/Support/Package.resolved +14 -0
- package/ios/Support/Package.swift +44 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNAttributes.m +52 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReportOps.m +236 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReports.m +184 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNDataRequestBridge.m +431 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNErrorMessage.m +40 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNEventBus.m +70 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNExceptions.m +63 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNGuardedEmit.mm +32 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNJSON.m +40 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNLaunchHold.m +147 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNMainThread.m +23 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkEvents.m +159 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkFilter.m +155 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNPluginEndpoint.m +21 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReactRootOriginTracker.m +63 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReactWindow.m +251 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportArgs.m +47 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportDeadlines.m +8 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportHandlerBridge.m +308 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportOps.m +345 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSecureRectangles.m +508 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSettleOnce.m +62 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSpanHandles.m +136 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNStatusMapper.m +18 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNTokens.m +9 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNValues.m +5 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapper.m +54 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapperChannelHolder.m +59 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNAttributes.h +63 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReportOps.h +51 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReports.h +81 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNDataRequestBridge.h +118 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNErrorMessage.h +30 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNEventBus.h +45 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNExceptions.h +31 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNGuardedEmit.h +31 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNJSON.h +25 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNLaunchHold.h +86 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNMainThread.h +32 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkEvents.h +28 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkFilter.h +28 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNPluginEndpoint.h +17 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactRootOriginTracker.h +48 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactWindow.h +135 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportArgs.h +17 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportDeadlines.h +37 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h +94 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h +86 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSecureRectangles.h +198 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSettleOnce.h +25 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSpanHandles.h +49 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNStatusMapper.h +26 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNTokens.h +14 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNValues.h +18 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapper.h +40 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h +74 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNAttributesTests.m +194 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportOpsTests.m +274 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportsTests.m +240 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNDataRequestBridgeTests.m +685 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNErrorMessageTests.m +102 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNEventBusTests.m +136 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNExceptionsTests.m +68 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h +41 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.m +166 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNGuardedEmitTests.mm +85 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNJSONTests.m +281 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNLaunchHoldTests.m +230 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNMainThreadTests.m +97 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkEventsTests.m +99 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkFilterTests.m +134 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNPluginEndpointTests.m +38 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactRootOriginTrackerTests.m +210 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactWindowTests.m +548 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportArgsTests.m +51 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportDeadlinesTests.m +22 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m +382 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportOpsTests.m +295 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSecureRectanglesTests.m +568 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSettleOnceTests.m +134 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSpanHandlesTests.m +153 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNStatusMapperTests.m +81 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNValuesTests.m +32 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m +205 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperTests.m +66 -0
- package/ios/react-native-spm-prefix.h +10 -0
- package/native-versions.json +10 -0
- package/package.json +62 -3
- package/plugin/build/bundle-phase.d.ts +41 -0
- package/plugin/build/bundle-phase.js +116 -0
- package/plugin/build/bundle-phase.js.map +1 -0
- package/plugin/build/dsym-script.d.ts +32 -0
- package/plugin/build/dsym-script.js +159 -0
- package/plugin/build/dsym-script.js.map +1 -0
- package/plugin/build/endpoint.d.ts +30 -0
- package/plugin/build/endpoint.js +69 -0
- package/plugin/build/endpoint.js.map +1 -0
- package/plugin/build/gradle.d.ts +65 -0
- package/plugin/build/gradle.js +1066 -0
- package/plugin/build/gradle.js.map +1 -0
- package/plugin/build/index.d.ts +85 -0
- package/plugin/build/index.js +217 -0
- package/plugin/build/index.js.map +1 -0
- package/plugin/build/manifest.d.ts +48 -0
- package/plugin/build/manifest.js +69 -0
- package/plugin/build/manifest.js.map +1 -0
- package/plugin/build/native-versions.baked.json +4 -0
- package/plugin/build/native-versions.d.ts +10 -0
- package/plugin/build/native-versions.js +27 -0
- package/plugin/build/native-versions.js.map +1 -0
- package/plugin/build/pbx-string.d.ts +8 -0
- package/plugin/build/pbx-string.js +31 -0
- package/plugin/build/pbx-string.js.map +1 -0
- package/plugin/build/podfile.d.ts +3 -0
- package/plugin/build/podfile.js +28 -0
- package/plugin/build/podfile.js.map +1 -0
- package/plugin/build/properties.d.ts +19 -0
- package/plugin/build/properties.js +41 -0
- package/plugin/build/properties.js.map +1 -0
- package/plugin/build/scheme.d.ts +20 -0
- package/plugin/build/scheme.js +107 -0
- package/plugin/build/scheme.js.map +1 -0
- package/react-native.config.js +26 -0
- package/scripts/bugsee-sourcemaps.gradle +201 -0
- package/scripts/bugsee-xcode.sh +83 -0
- package/scripts/compose-then-inject.js +113 -0
- package/scripts/hermes-sourcemaps.js +634 -0
- package/scripts/hermesc-preserve-js.cmd +6 -0
- package/scripts/hermesc-preserve-js.js +200 -0
- package/scripts/hermesc-preserve-js.sh +7 -0
- package/src/NativeBugsee.ts +622 -0
- package/src/apm/notify.ts +58 -0
- package/src/apm/span.ts +403 -0
- package/src/apm/types.ts +57 -0
- package/src/appearance/report.ts +171 -0
- package/src/architecture.ts +48 -0
- package/src/attributes/errors.ts +39 -0
- package/src/attributes/validate.ts +150 -0
- package/src/breadcrumbs/add.ts +58 -0
- package/src/breadcrumbs/data.ts +33 -0
- package/src/breadcrumbs/filter.ts +215 -0
- package/src/breadcrumbs/types.ts +64 -0
- package/src/bridge/json.ts +110 -0
- package/src/console/capture.ts +180 -0
- package/src/console/dedup.ts +175 -0
- package/src/data/validate.ts +259 -0
- package/src/errorName.ts +32 -0
- package/src/exceptions/ErrorBoundary.tsx +92 -0
- package/src/exceptions/RootErrorReporter.tsx +61 -0
- package/src/exceptions/debugIds.ts +118 -0
- package/src/exceptions/handlers.ts +236 -0
- package/src/exceptions/options.ts +85 -0
- package/src/exceptions/payload.ts +456 -0
- package/src/exceptions/report.ts +170 -0
- package/src/exceptions/sha1.ts +148 -0
- package/src/exceptions/stack.ts +355 -0
- package/src/index.ts +962 -0
- package/src/logs/filter.ts +90 -0
- package/src/logs/log.ts +36 -0
- package/src/network/add.ts +165 -0
- package/src/network/filter.ts +198 -0
- package/src/options/AndroidLaunchOptions.ts +78 -0
- package/src/options/BugseeLaunchOptions.ts +190 -0
- package/src/options/IOSLaunchOptions.ts +57 -0
- package/src/options/android-options-manifest.json +646 -0
- package/src/options/createDefaultLaunchOptions.ts +29 -0
- package/src/options/endpoint.ts +58 -0
- package/src/options/enums.ts +104 -0
- package/src/options/ios-enums.json +19 -0
- package/src/options/keys.ts +39 -0
- package/src/options/option-enums.json +34 -0
- package/src/options/option-keys.json +107 -0
- package/src/report/BugseeReport.ts +264 -0
- package/src/report/CreatedReport.ts +127 -0
- package/src/report/dispatcher.ts +95 -0
- package/src/report/errors.ts +48 -0
- package/src/report/fields.ts +40 -0
- package/src/report/types.ts +157 -0
- package/src/report/validate.ts +197 -0
- package/src/secure/BugseeSecure.tsx +202 -0
- package/src/secure/ancestry.ts +622 -0
- package/src/secure/drivers.ts +342 -0
- package/src/secure/followEvents.ts +57 -0
- package/src/secure/hold.ts +99 -0
- package/src/secure/measureLoop.ts +323 -0
- package/src/secure/nativeAnimation.ts +1005 -0
- package/src/secure/rectangles.ts +93 -0
- package/src/secure/registry.ts +237 -0
- package/src/secure/surface.ts +83 -0
- package/src/secure/tracker.ts +723 -0
- package/src/secure/transition.ts +488 -0
- package/src/secure/unit.ts +22 -0
- package/src/status.ts +16 -0
- package/src/version.ts +9 -0
- package/src/viewtree/anchor.tsx +105 -0
- package/src/viewtree/constants.ts +20 -0
- package/src/viewtree/fiber.ts +251 -0
- package/src/viewtree/requests.ts +347 -0
- package/src/viewtree/walk.ts +902 -0
- package/src/wrapper/channel.ts +33 -0
- package/src/wrapper/collect.ts +52 -0
- package/src/wrapper/events.ts +45 -0
- package/src/wrapper/identity.ts +54 -0
- package/src/wrapper/lifecycle-events.ts +89 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { classifyFilterRequest } from '../console/dedup';
|
|
2
|
+
import NativeBugsee from '../NativeBugsee';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One log line in, the line to keep out.
|
|
6
|
+
*
|
|
7
|
+
* A string replaces the line. `null` and `undefined` drop it. A promise is
|
|
8
|
+
* waited on; the native SDK is what bounds that wait. This function does not
|
|
9
|
+
* add a timeout of its own: both SDKs already drop a line whose filter does
|
|
10
|
+
* not answer, and a timeout here that then passed the original line would
|
|
11
|
+
* leak exactly what the filter exists to remove.
|
|
12
|
+
*/
|
|
13
|
+
export type LogFilter = (
|
|
14
|
+
line: string,
|
|
15
|
+
) => string | null | undefined | Promise<string | null | undefined>;
|
|
16
|
+
|
|
17
|
+
let current: LogFilter | undefined;
|
|
18
|
+
let subscribed = false;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Registers `callback` as the only log filter. A later call replaces it.
|
|
22
|
+
* `undefined` or `null` clears it, which tells native to uninstall the filter
|
|
23
|
+
* so lines are recorded without one.
|
|
24
|
+
*
|
|
25
|
+
* The JS listener is subscribed before the native filter is installed, so a
|
|
26
|
+
* line filtered on the installing turn still has a listener. On iOS a request
|
|
27
|
+
* emitted in that gap stays in the pending table until process death. The
|
|
28
|
+
* subscription stays: clearing the callback stops native from asking, and a
|
|
29
|
+
* later callback must still be able to answer.
|
|
30
|
+
*/
|
|
31
|
+
export function setLogFilter(callback?: LogFilter | null): void {
|
|
32
|
+
if (callback != null && typeof callback !== 'function') {
|
|
33
|
+
throw new TypeError(
|
|
34
|
+
`Bugsee.setLogFilter requires a function, got ${typeof callback}`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
if (callback != null && !subscribed) {
|
|
38
|
+
NativeBugsee.onLogFilterRequest(onLogFilterRequest);
|
|
39
|
+
subscribed = true;
|
|
40
|
+
}
|
|
41
|
+
current = callback ?? undefined;
|
|
42
|
+
NativeBugsee.setLogFilterEnabled(current !== undefined);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Answers one native filter request.
|
|
47
|
+
*
|
|
48
|
+
* The callback is read here, at dispatch, so a `setLogFilter` made while this
|
|
49
|
+
* request is in flight changes the next line, not this one. The callback
|
|
50
|
+
* itself runs on a later turn: the native side has already returned, and
|
|
51
|
+
* waiting for the callback on this turn would block the JS thread that
|
|
52
|
+
* produced the line.
|
|
53
|
+
*
|
|
54
|
+
* A throw, a rejection, or a result that is not a string drops the line.
|
|
55
|
+
* A callback that never settles does not reply at all — the SDK's own timeout
|
|
56
|
+
* drops it. Neither path replies with the original line.
|
|
57
|
+
*/
|
|
58
|
+
function onLogFilterRequest(event: { requestId: string; line: string }): void {
|
|
59
|
+
const callback = current;
|
|
60
|
+
const { requestId } = event;
|
|
61
|
+
// The RCTLog echo of a console call the JS patch already forwarded.
|
|
62
|
+
// Answered here, before the user's callback, so a filter that samples,
|
|
63
|
+
// counts, or appends runs once. Null drops the echo; it does not pass
|
|
64
|
+
// the line through.
|
|
65
|
+
if (classifyFilterRequest(event.line) === 'drop') {
|
|
66
|
+
reply(requestId, null);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (callback === undefined) {
|
|
70
|
+
reply(requestId, null);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
Promise.resolve()
|
|
75
|
+
.then(() => callback(event.line))
|
|
76
|
+
.then((result) => {
|
|
77
|
+
reply(requestId, typeof result === 'string' ? result : null);
|
|
78
|
+
})
|
|
79
|
+
.catch(() => {
|
|
80
|
+
reply(requestId, null);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function reply(requestId: string, line: string | null): void {
|
|
85
|
+
try {
|
|
86
|
+
NativeBugsee.replyLogFilter(requestId, line);
|
|
87
|
+
} catch {
|
|
88
|
+
// The bridge is gone. An unanswered request is dropped by the SDK.
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/logs/log.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import NativeBugsee from '../NativeBugsee';
|
|
2
|
+
import { LogLevel } from '../options/enums';
|
|
3
|
+
|
|
4
|
+
const LEVELS: ReadonlySet<number> = new Set(Object.values(LogLevel));
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The app's own line, through the SDK's public `Bugsee.log` -- not the
|
|
8
|
+
* wrapper channel, which carries only what this wrapper captured on its own
|
|
9
|
+
* (`console.*`, RCTLog) and records nothing with `capture.logs` off
|
|
10
|
+
* (`bugsee/specs` `sdk/wrapper-channel`).
|
|
11
|
+
*
|
|
12
|
+
* `requiresFiltering` is passed through as the app chose it. As in the
|
|
13
|
+
* native SDKs, the app's log filter skips the line unless it is `true`; then
|
|
14
|
+
* the filter runs on it natively, once.
|
|
15
|
+
*
|
|
16
|
+
* The level crosses by value, 1 Error .. 5 Verbose, as on the channel
|
|
17
|
+
* (`forwardLog`), and is rejected here otherwise, for the same reasons.
|
|
18
|
+
*/
|
|
19
|
+
export function log(
|
|
20
|
+
message: string,
|
|
21
|
+
level: LogLevel = LogLevel.Info,
|
|
22
|
+
requiresFiltering: boolean = false,
|
|
23
|
+
): void {
|
|
24
|
+
if (typeof message !== 'string') {
|
|
25
|
+
throw new TypeError(`Bugsee.log requires message to be a string, got ${typeof message}`);
|
|
26
|
+
}
|
|
27
|
+
if (!LEVELS.has(level)) {
|
|
28
|
+
throw new RangeError('Bugsee.log requires a LogLevel (1-5)');
|
|
29
|
+
}
|
|
30
|
+
if (typeof requiresFiltering !== 'boolean') {
|
|
31
|
+
throw new TypeError(
|
|
32
|
+
`Bugsee.log requires requiresFiltering to be a boolean, got ${typeof requiresFiltering}`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
NativeBugsee.log(message, level, requiresFiltering);
|
|
36
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import NativeBugsee from '../NativeBugsee';
|
|
2
|
+
import { encodeBridgeObject } from '../bridge/json';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A network event the app records itself, for a stack the SDK does not
|
|
6
|
+
* instrument. The bridge stamps the time. Native builds the event with the
|
|
7
|
+
* SDK exchange factory and submits it with filtering required, so an
|
|
8
|
+
* installed {@link import('./filter').setNetworkFilter} still sees it. This
|
|
9
|
+
* function does not run that filter.
|
|
10
|
+
*/
|
|
11
|
+
export interface AddedNetworkEvent {
|
|
12
|
+
url: string;
|
|
13
|
+
method: string;
|
|
14
|
+
/**
|
|
15
|
+
* A stage name. `completed` is the name a device test records; it is the
|
|
16
|
+
* native completed stage (`complete` on the wire). Omitted means that
|
|
17
|
+
* same stage.
|
|
18
|
+
*/
|
|
19
|
+
stage?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
body?: string | null;
|
|
22
|
+
headers?: Record<string, string> | null;
|
|
23
|
+
responseCode?: number;
|
|
24
|
+
/** Android stores this. iOS drops it. The event is still recorded. */
|
|
25
|
+
statusText?: string | null;
|
|
26
|
+
/** Android stores this. iOS drops it. The event is still recorded. */
|
|
27
|
+
errorDescription?: string | null;
|
|
28
|
+
/** Android stores this. iOS drops it. The event is still recorded. */
|
|
29
|
+
errorShortMessage?: string | null;
|
|
30
|
+
/** iOS stores this. Android does not. The event is still recorded. */
|
|
31
|
+
redirectedFromURL?: string | null;
|
|
32
|
+
/** iOS stores this. Android does not. The event is still recorded. */
|
|
33
|
+
error?: Record<string, unknown> | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Stage names the caller may pass, and the wire value native maps onto a
|
|
38
|
+
* stage. `completed` is not the native `toString` (`complete`); it is the
|
|
39
|
+
* name the device test uses.
|
|
40
|
+
*/
|
|
41
|
+
const STAGE_WIRE: Readonly<Record<string, string>> = {
|
|
42
|
+
completed: 'complete',
|
|
43
|
+
complete: 'complete',
|
|
44
|
+
before: 'before',
|
|
45
|
+
started: 'before',
|
|
46
|
+
redirect: 'redirect',
|
|
47
|
+
error: 'error',
|
|
48
|
+
abort: 'abort',
|
|
49
|
+
aborted: 'abort',
|
|
50
|
+
cancel: 'abort',
|
|
51
|
+
timing: 'timing',
|
|
52
|
+
timings: 'timing',
|
|
53
|
+
websocket: 'websocket',
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const OPTIONAL_KEYS = [
|
|
57
|
+
'id',
|
|
58
|
+
'body',
|
|
59
|
+
'headers',
|
|
60
|
+
'responseCode',
|
|
61
|
+
'statusText',
|
|
62
|
+
'errorDescription',
|
|
63
|
+
'errorShortMessage',
|
|
64
|
+
'redirectedFromURL',
|
|
65
|
+
'error',
|
|
66
|
+
] as const;
|
|
67
|
+
|
|
68
|
+
export function addNetworkEvent(event: AddedNetworkEvent): void {
|
|
69
|
+
if (!isEvent(event)) {
|
|
70
|
+
const kind = event === null ? 'null' : Array.isArray(event) ? 'array' : typeof event;
|
|
71
|
+
throw new TypeError(`Bugsee.addNetworkEvent requires an object, got ${kind}`);
|
|
72
|
+
}
|
|
73
|
+
if (typeof event.url !== 'string') {
|
|
74
|
+
throw new TypeError(
|
|
75
|
+
`Bugsee.addNetworkEvent requires a string url, got ${typeof event.url}`,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
if (typeof event.method !== 'string') {
|
|
79
|
+
throw new TypeError(
|
|
80
|
+
`Bugsee.addNetworkEvent requires a string method, got ${typeof event.method}`,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
const stageName = event.stage === undefined ? 'completed' : event.stage;
|
|
84
|
+
if (typeof stageName !== 'string' || STAGE_WIRE[stageName] === undefined) {
|
|
85
|
+
throw new TypeError('Bugsee.addNetworkEvent stage must name a network stage');
|
|
86
|
+
}
|
|
87
|
+
const wire: Record<string, unknown> = {
|
|
88
|
+
url: event.url,
|
|
89
|
+
method: event.method,
|
|
90
|
+
stage: STAGE_WIRE[stageName],
|
|
91
|
+
};
|
|
92
|
+
for (const key of OPTIONAL_KEYS) {
|
|
93
|
+
if (!Object.prototype.hasOwnProperty.call(event, key)) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const value = event[key];
|
|
97
|
+
if (key === 'headers') {
|
|
98
|
+
wire.headers = headersValue(value);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (key === 'error') {
|
|
102
|
+
wire.error = errorValue(value);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (key === 'responseCode') {
|
|
106
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
107
|
+
throw new TypeError('Bugsee.addNetworkEvent responseCode must be a finite number');
|
|
108
|
+
}
|
|
109
|
+
wire.responseCode = value;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (key === 'id' || key === 'body' || key === 'statusText' || key === 'errorDescription'
|
|
113
|
+
|| key === 'errorShortMessage' || key === 'redirectedFromURL') {
|
|
114
|
+
if (value !== null && typeof value !== 'string') {
|
|
115
|
+
throw new TypeError(
|
|
116
|
+
`Bugsee.addNetworkEvent ${key} must be a string or null, got ${typeof value}`,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
wire[key] = value;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
NativeBugsee.addNetworkEvent(encodeBridgeObject(wire));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function isEvent(value: unknown): value is AddedNetworkEvent {
|
|
126
|
+
return isPlainObject(value);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
130
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function headersValue(value: unknown): Record<string, string> | null {
|
|
134
|
+
if (value === null) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
if (!isPlainObject(value)) {
|
|
138
|
+
throw new TypeError(
|
|
139
|
+
`Bugsee.addNetworkEvent headers must be an object or null, got ${typeof value}`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
const headers: Record<string, string> = {};
|
|
143
|
+
for (const key of Object.keys(value)) {
|
|
144
|
+
const header = value[key];
|
|
145
|
+
if (typeof header !== 'string') {
|
|
146
|
+
throw new TypeError(
|
|
147
|
+
`Bugsee.addNetworkEvent headers.${key} must be a string, got ${typeof header}`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
headers[key] = header;
|
|
151
|
+
}
|
|
152
|
+
return headers;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function errorValue(value: unknown): Record<string, unknown> | null {
|
|
156
|
+
if (value === null) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
if (!isPlainObject(value)) {
|
|
160
|
+
throw new TypeError(
|
|
161
|
+
`Bugsee.addNetworkEvent error must be an object or null, got ${typeof value}`,
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
return { ...value };
|
|
165
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import NativeBugsee from '../NativeBugsee';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* One network event in, the event to keep out.
|
|
5
|
+
*
|
|
6
|
+
* The native keep-value is the event object (`Callback1<NetworkEvent>` on
|
|
7
|
+
* Android, `BugseeNetworkFilterDecisionBlock` on iOS), so a replacement is
|
|
8
|
+
* that object — not a string. `null` and `undefined` drop it. A promise is
|
|
9
|
+
* waited on; the native SDK is what bounds that wait. This function does not
|
|
10
|
+
* add a timeout of its own: a timeout here that then passed the original
|
|
11
|
+
* event would leak exactly what the filter exists to remove.
|
|
12
|
+
*/
|
|
13
|
+
export interface NetworkFilterEvent {
|
|
14
|
+
id: string | null;
|
|
15
|
+
url: string | null;
|
|
16
|
+
method: string | null;
|
|
17
|
+
/** Omitted when the native snapshot left the key out (iOS binary body). */
|
|
18
|
+
body?: string | null;
|
|
19
|
+
/** Omitted when the native snapshot left the key out. */
|
|
20
|
+
headers?: Record<string, string> | null;
|
|
21
|
+
mechanism: string | null;
|
|
22
|
+
type: string | null;
|
|
23
|
+
websocketEvent: string | null;
|
|
24
|
+
responseCode: number;
|
|
25
|
+
/** Android. Present, including `null`, when the snapshot sent the key. */
|
|
26
|
+
errorDescription?: string | null;
|
|
27
|
+
/** Android. Present, including `null`, when the snapshot sent the key. */
|
|
28
|
+
errorShortMessage?: string | null;
|
|
29
|
+
/** Android. Present, including `null`, when the snapshot sent the key. */
|
|
30
|
+
statusText?: string | null;
|
|
31
|
+
/** iOS. Present, including `null`, when the snapshot sent the key. */
|
|
32
|
+
redirectedFromURL?: string | null;
|
|
33
|
+
/** iOS. A dictionary, or `null`, when the snapshot sent the key. */
|
|
34
|
+
error?: Record<string, unknown> | null;
|
|
35
|
+
/**
|
|
36
|
+
* Android, read-only. Since Android SDK 7.3.1 one request can reach the
|
|
37
|
+
* filter as more than one event with the same `id` and `type`: a supplement
|
|
38
|
+
* of an earlier one, carrying a part known only later (typically the
|
|
39
|
+
* request body), has `override` true. Filter it like any other event; a
|
|
40
|
+
* changed value is not written back.
|
|
41
|
+
*/
|
|
42
|
+
override?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type NetworkFilter = (
|
|
46
|
+
event: NetworkFilterEvent,
|
|
47
|
+
) =>
|
|
48
|
+
| NetworkFilterEvent
|
|
49
|
+
| null
|
|
50
|
+
| undefined
|
|
51
|
+
| Promise<NetworkFilterEvent | null | undefined>;
|
|
52
|
+
|
|
53
|
+
let current: NetworkFilter | undefined;
|
|
54
|
+
let subscribed = false;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Registers `callback` as the only network filter. A later call replaces it.
|
|
58
|
+
* `undefined` or `null` clears it, which tells native to uninstall the filter
|
|
59
|
+
* so events are recorded without one.
|
|
60
|
+
*
|
|
61
|
+
* The native request is subscribed to once and stays subscribed: clearing the
|
|
62
|
+
* callback stops native from asking, and a later callback must still be able
|
|
63
|
+
* to answer.
|
|
64
|
+
*/
|
|
65
|
+
export function setNetworkFilter(callback?: NetworkFilter | null): void {
|
|
66
|
+
if (callback != null && typeof callback !== 'function') {
|
|
67
|
+
throw new TypeError(
|
|
68
|
+
`Bugsee.setNetworkFilter requires a function, got ${typeof callback}`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
// Subscribe before the native filter is installed. An event that arrives
|
|
72
|
+
// in the gap is emitted to nobody and then dropped, which is how the
|
|
73
|
+
// session's `before` stage was lost on a device.
|
|
74
|
+
if (callback != null && !subscribed) {
|
|
75
|
+
subscribed = true;
|
|
76
|
+
NativeBugsee.onNetworkFilterRequest(onNetworkFilterRequest);
|
|
77
|
+
}
|
|
78
|
+
current = callback ?? undefined;
|
|
79
|
+
NativeBugsee.setNetworkFilterEnabled(current !== undefined);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Answers one native filter request.
|
|
84
|
+
*
|
|
85
|
+
* The callback is read here, at dispatch, so a `setNetworkFilter` made while
|
|
86
|
+
* this request is in flight changes the next event, not this one. The
|
|
87
|
+
* callback itself runs on a later turn: the native side has already returned,
|
|
88
|
+
* and waiting for the callback on this turn would block the JS thread.
|
|
89
|
+
*
|
|
90
|
+
* A throw, a rejection, a result that is not the event object, or a result
|
|
91
|
+
* that omits a writable key the snapshot sent drops the event. `url` is
|
|
92
|
+
* always one of those keys. `body`, `headers`, `errorDescription`,
|
|
93
|
+
* `errorShortMessage`, `statusText`, `redirectedFromURL`, and `error` are
|
|
94
|
+
* too, when the snapshot sent that key, including when the value was
|
|
95
|
+
* `null`. A `null` value on a key the snapshot sent is an explicit clear.
|
|
96
|
+
* A key the snapshot omitted stays omitted: a `null` the callback wrote
|
|
97
|
+
* for that key is left out of the reply, so `body: event.body ?? null`
|
|
98
|
+
* does not clear a body the snapshot never had. A callback that never
|
|
99
|
+
* settles does not reply at all — the SDK's own timeout drops it.
|
|
100
|
+
* Neither path replies with the original event.
|
|
101
|
+
*/
|
|
102
|
+
function onNetworkFilterRequest(event: { requestId: string; eventJson: string }): void {
|
|
103
|
+
const callback = current;
|
|
104
|
+
const { requestId } = event;
|
|
105
|
+
if (callback === undefined) {
|
|
106
|
+
reply(requestId, null);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let parsed: NetworkFilterEvent;
|
|
111
|
+
try {
|
|
112
|
+
parsed = JSON.parse(event.eventJson) as NetworkFilterEvent;
|
|
113
|
+
} catch {
|
|
114
|
+
reply(requestId, null);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
Promise.resolve()
|
|
119
|
+
.then(() => callback(parsed))
|
|
120
|
+
.then((result) => {
|
|
121
|
+
reply(requestId, replacementJson(parsed, result));
|
|
122
|
+
})
|
|
123
|
+
.catch(() => {
|
|
124
|
+
reply(requestId, null);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Writable when the snapshot sent them. `url` is always required. */
|
|
129
|
+
const OPTIONAL_WRITABLE = [
|
|
130
|
+
'body',
|
|
131
|
+
'headers',
|
|
132
|
+
'errorDescription',
|
|
133
|
+
'errorShortMessage',
|
|
134
|
+
'statusText',
|
|
135
|
+
'redirectedFromURL',
|
|
136
|
+
'error',
|
|
137
|
+
] as const;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The event object, as JSON, or `null` when the result cannot be kept.
|
|
141
|
+
*
|
|
142
|
+
* A keep has to name every writable key the snapshot sent. Native writes
|
|
143
|
+
* only keys that are present, so a partial object would leave the fields it
|
|
144
|
+
* omitted on the event. `JSON.stringify` also drops `undefined`. A `null`
|
|
145
|
+
* on a key the snapshot omitted is dropped from the reply before that, so
|
|
146
|
+
* it is not a clear.
|
|
147
|
+
*/
|
|
148
|
+
function replacementJson(received: NetworkFilterEvent, result: unknown): string | null {
|
|
149
|
+
if (!isEvent(result) || !keepsReceivedWritableKeys(received, result)) {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
const reply: Record<string, unknown> = {};
|
|
153
|
+
for (const key of Object.keys(result)) {
|
|
154
|
+
const value = result[key];
|
|
155
|
+
// A null on a key the snapshot never sent is the callback filling in
|
|
156
|
+
// `event.body ?? null`. Native would treat a present null as a clear.
|
|
157
|
+
if (
|
|
158
|
+
key !== 'url' &&
|
|
159
|
+
value === null &&
|
|
160
|
+
!Object.prototype.hasOwnProperty.call(received, key)
|
|
161
|
+
) {
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
reply[key] = value;
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
return JSON.stringify(reply);
|
|
168
|
+
} catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function keepsReceivedWritableKeys(
|
|
174
|
+
received: NetworkFilterEvent,
|
|
175
|
+
result: Record<string, unknown>,
|
|
176
|
+
): boolean {
|
|
177
|
+
if (!Object.prototype.hasOwnProperty.call(result, 'url') || result.url === undefined) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
return OPTIONAL_WRITABLE.every((key) => {
|
|
181
|
+
if (!Object.prototype.hasOwnProperty.call(received, key)) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
return Object.prototype.hasOwnProperty.call(result, key) && result[key] !== undefined;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function isEvent(value: unknown): value is Record<string, unknown> {
|
|
189
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function reply(requestId: string, eventJson: string | null): void {
|
|
193
|
+
try {
|
|
194
|
+
NativeBugsee.replyNetworkFilter(requestId, eventJson);
|
|
195
|
+
} catch {
|
|
196
|
+
// The bridge is gone. An unanswered request is dropped by the SDK.
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { BugseeLaunchOptions } from './BugseeLaunchOptions';
|
|
2
|
+
import { ANDROID_ENDPOINT_KEY, endpointFor } from './endpoint';
|
|
3
|
+
|
|
4
|
+
/** Launch options for Android, adding the keys only that SDK accepts. */
|
|
5
|
+
export class AndroidLaunchOptions extends BugseeLaunchOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The API endpoint override.
|
|
8
|
+
*
|
|
9
|
+
* Reads back what the SDK will actually receive rather than what
|
|
10
|
+
* was assigned, because the two differ on iOS.
|
|
11
|
+
*/
|
|
12
|
+
get endpoint(): string | undefined {
|
|
13
|
+
return this.$get(ANDROID_ENDPOINT_KEY);
|
|
14
|
+
}
|
|
15
|
+
set endpoint(value: string | undefined) {
|
|
16
|
+
const payload = endpointFor('android', value);
|
|
17
|
+
this.$set(ANDROID_ENDPOINT_KEY, payload[ANDROID_ENDPOINT_KEY]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get videoMode(): number | undefined {
|
|
21
|
+
return this.$get('com.bugsee.option.capture.video.mode');
|
|
22
|
+
}
|
|
23
|
+
set videoMode(value: number | undefined) {
|
|
24
|
+
this.$set('com.bugsee.option.capture.video.mode', value);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get logsUseAllSources(): boolean | undefined {
|
|
28
|
+
return this.$get('com.bugsee.option.capture.logs.allsources');
|
|
29
|
+
}
|
|
30
|
+
set logsUseAllSources(value: boolean | undefined) {
|
|
31
|
+
this.$set('com.bugsee.option.capture.logs.allsources', value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get detectAndReportExitLowMemory(): boolean | undefined {
|
|
35
|
+
return this.$get('com.bugsee.option.detect.exit.low_memory');
|
|
36
|
+
}
|
|
37
|
+
set detectAndReportExitLowMemory(value: boolean | undefined) {
|
|
38
|
+
this.$set('com.bugsee.option.detect.exit.low_memory', value);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Report a low-memory kill of a process that was not in the foreground as
|
|
43
|
+
* a non-fatal error rather than a crash. Applies only while
|
|
44
|
+
* {@link detectAndReportExitLowMemory} is on. Android 7.3.0.
|
|
45
|
+
*/
|
|
46
|
+
get detectAndReportExitLowMemoryBackgroundAsError(): boolean | undefined {
|
|
47
|
+
return this.$get('com.bugsee.option.detect.exit.bg_low_memory_as_error');
|
|
48
|
+
}
|
|
49
|
+
set detectAndReportExitLowMemoryBackgroundAsError(value: boolean | undefined) {
|
|
50
|
+
this.$set('com.bugsee.option.detect.exit.bg_low_memory_as_error', value);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Most reports kept waiting to be sent. Android 7.3.0. */
|
|
54
|
+
get maxPendingReports(): number | undefined {
|
|
55
|
+
return this.$get('com.bugsee.option.config.max-pending-reports');
|
|
56
|
+
}
|
|
57
|
+
set maxPendingReports(value: number | undefined) {
|
|
58
|
+
this.$set('com.bugsee.option.config.max-pending-reports', value);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Oldest a report waiting to be sent may get, in days; `0` or less keeps
|
|
63
|
+
* reports until they are sent or evicted. Android 7.3.0.
|
|
64
|
+
*/
|
|
65
|
+
get maxPendingReportAge(): number | undefined {
|
|
66
|
+
return this.$get('com.bugsee.option.config.max-pending-report-age');
|
|
67
|
+
}
|
|
68
|
+
set maxPendingReportAge(value: number | undefined) {
|
|
69
|
+
this.$set('com.bugsee.option.config.max-pending-report-age', value);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get triggerByNotification(): boolean | undefined {
|
|
73
|
+
return this.$get('com.bugsee.option.reporting.triggers.notification-bar');
|
|
74
|
+
}
|
|
75
|
+
set triggerByNotification(value: boolean | undefined) {
|
|
76
|
+
this.$set('com.bugsee.option.reporting.triggers.notification-bar', value);
|
|
77
|
+
}
|
|
78
|
+
}
|