Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Rename shouldInitializeNativeSdk to autoInitializeNativeSdk #1275

Merged
merged 3 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

- fix: pas maxBreadcrumbs to Android init
- feat: Allow disabling native SDK initialization but still use it #1259
- ref: Rename shouldInitializeNativeSdk to autoInitializeNativeSdk #1275
- fix: Fix parseErrorStack that only takes string in DebugSymbolicator event processor #1274
- fix: Only set "event" type in envelope item and not the payload #1271


## 2.1.0

- feat: Include @sentry/tracing and expose startTransaction #1167
Expand Down
2 changes: 1 addition & 1 deletion src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface ReactNativeOptions extends BrowserOptions {
*
* @default true
*/
shouldInitializeNativeSdk?: boolean;
autoInitializeNativeSdk?: boolean;

/** Maximum time to wait to drain the request queue, before the process is allowed to exit. */
shutdownTimeout?: number;
Expand Down
2 changes: 1 addition & 1 deletion src/js/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DEFAULT_OPTIONS: ReactNativeOptions = {
enableNative: true,
enableNativeCrashHandling: true,
enableNativeNagger: true,
shouldInitializeNativeSdk: true,
autoInitializeNativeSdk: true,
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/js/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ export const NATIVE = {
async startWithOptions(_options: ReactNativeOptions): Promise<boolean> {
const options = {
enableNative: true,
shouldInitializeNativeSdk: true,
autoInitializeNativeSdk: true,
..._options,
};

if (!options.shouldInitializeNativeSdk) {
if (!options.autoInitializeNativeSdk) {
if (options.enableNativeNagger) {
logger.warn("Note: Native Sentry SDK was not initialized.");
}
Expand Down
4 changes: 2 additions & 2 deletions test/wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("Tests Native Wrapper", () => {
);
});

test("does not initialize with shouldInitializeNativeSdk: false", async () => {
test("does not initialize with autoInitializeNativeSdk: false", async () => {
const RN = require("react-native");

RN.NativeModules.RNSentry.startWithOptions = jest.fn();
Expand All @@ -102,7 +102,7 @@ describe("Tests Native Wrapper", () => {
await NATIVE.startWithOptions({
dsn: "test",
enableNative: true,
shouldInitializeNativeSdk: false,
autoInitializeNativeSdk: false,
});

expect(RN.NativeModules.RNSentry.startWithOptions).not.toBeCalled();
Expand Down