Skip to content

Commit c555889

Browse files
author
farfromrefug
committed
fix: missing breadcrumbs and data on native crashes
1 parent 6b779f4 commit c555889

File tree

9 files changed

+491
-288
lines changed

9 files changed

+491
-288
lines changed

packages/sentry/scope.d.ts

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,53 @@
1-
export {};
1+
import { Scope } from '@sentry/core';
2+
import type { Attachment, Breadcrumb, User } from '@sentry/types';
3+
/**
4+
* Extends the scope methods to set scope on the Native SDKs
5+
*/
6+
export declare class NativescriptScope extends Scope {
7+
/**
8+
* @inheritDoc
9+
*/
10+
setUser(user: User | null): this;
11+
/**
12+
* @inheritDoc
13+
*/
14+
setTag(key: string, value: string): this;
15+
/**
16+
* @inheritDoc
17+
*/
18+
setTags(tags: {
19+
[key: string]: string;
20+
}): this;
21+
/**
22+
* @inheritDoc
23+
*/
24+
setExtras(extras: {
25+
[key: string]: any;
26+
}): this;
27+
/**
28+
* @inheritDoc
29+
*/
30+
setExtra(key: string, extra: any): this;
31+
/**
32+
* @inheritDoc
33+
*/
34+
addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
35+
/**
36+
* @inheritDoc
37+
*/
38+
clearBreadcrumbs(): this;
39+
/**
40+
* @inheritDoc
41+
*/
42+
setContext(key: string, context: {
43+
[key: string]: any;
44+
} | null): this;
45+
/**
46+
* @inheritDoc
47+
*/
48+
addAttachment(attachment: Attachment): this;
49+
/**
50+
* @inheritDoc
51+
*/
52+
clearAttachments(): this;
53+
}

packages/sentry/scope.js

Lines changed: 89 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sentry/wrapper.android.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Envelope } from '@sentry/types';
1+
import { Breadcrumb, Envelope, User } from '@sentry/types';
22
import { NativescriptOptions } from './options';
33
export declare namespace NATIVE {
44
function isNativeTransportAvailable(): boolean;
@@ -35,4 +35,12 @@ export declare namespace NATIVE {
3535
isColdStart: java.lang.Boolean;
3636
didFetchAppStart: boolean;
3737
}>;
38+
function setUser(user: User | null, otherUserKeys: any): void;
39+
function setTag(key: string, value: string): void;
40+
function setExtra(key: string, extra: any): void;
41+
function addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): void;
42+
function clearBreadcrumbs(): void;
43+
function setContext(key: string, context: {
44+
[key: string]: any;
45+
} | null): void;
3846
}

src/sentry/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export {
1313
setContext,
1414
setExtra,
1515
setExtras,
16-
withScope,
17-
configureScope,
1816
setTag,
1917
setTags,
2018
setUser,
@@ -40,7 +38,7 @@ import { Trace } from '@nativescript/core';
4038
export { NativescriptOptions } from './options';
4139
export { NativescriptClient } from './client';
4240

43-
export { init, setDist, setRelease, nativeCrash, flush, close, captureUserFeedback } from './sdk';
41+
export { configureScope, init, setDist, setRelease, nativeCrash, flush, close, captureUserFeedback , withScope} from './sdk';
4442
// export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
4543

4644
export {

0 commit comments

Comments
 (0)