fix: standardnotes bugsnag patch
This commit is contained in:
parent
18fbf80218
commit
a6aa371e9e
|
@ -633,7 +633,7 @@ Builds:
|
|||
- yarn cache clean snjs
|
||||
- npm_config_build_from_source=true yarn --force
|
||||
patch:
|
||||
- bugsnag.patch
|
||||
- bugsnag-3.6.11.patch
|
||||
gradle:
|
||||
- prod
|
||||
srclibs:
|
||||
|
|
|
@ -0,0 +1,158 @@
|
|||
diff --git a/android/app/build.gradle b/android/app/build.gradle
|
||||
index 8310498..17fe350 100644
|
||||
--- a/android/app/build.gradle
|
||||
+++ b/android/app/build.gradle
|
||||
@@ -252,5 +252,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
|
||||
into 'libs'
|
||||
}
|
||||
|
||||
-apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
||||
-apply from: "../../node_modules/@bugsnag/react-native/bugsnag-react-native.gradle"
|
||||
\ No newline at end of file
|
||||
+apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
||||
\ No newline at end of file
|
||||
diff --git a/android/app/src/main/java/com/standardnotes/MainApplication.java b/android/app/src/main/java/com/standardnotes/MainApplication.java
|
||||
index 69c4085..d76ecba 100644
|
||||
--- a/android/app/src/main/java/com/standardnotes/MainApplication.java
|
||||
+++ b/android/app/src/main/java/com/standardnotes/MainApplication.java
|
||||
@@ -5,8 +5,6 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.webkit.WebView;
|
||||
|
||||
-import com.bugsnag.android.BreadcrumbType;
|
||||
-import com.bugsnag.android.Configuration;
|
||||
import com.facebook.react.PackageList;
|
||||
import com.facebook.react.ReactApplication;
|
||||
import com.facebook.react.ReactInstanceManager;
|
||||
@@ -19,7 +17,6 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
-import com.bugsnag.android.Bugsnag;
|
||||
import com.facebook.react.modules.network.OkHttpClientProvider;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
@@ -74,24 +71,6 @@ public class MainApplication extends Application implements ReactApplication {
|
||||
|
||||
rebuildOkHtttp();
|
||||
|
||||
- Configuration config = Configuration.load(this);
|
||||
- config.setEnabledBreadcrumbTypes(new HashSet<BreadcrumbType>() {{
|
||||
- add(BreadcrumbType.NAVIGATION);
|
||||
- add(BreadcrumbType.STATE);
|
||||
- add(BreadcrumbType.PROCESS);
|
||||
- add(BreadcrumbType.MANUAL);
|
||||
- add(BreadcrumbType.USER);
|
||||
- add(BreadcrumbType.LOG);
|
||||
- add(BreadcrumbType.ERROR);
|
||||
- }});
|
||||
-
|
||||
- SharedPreferences settings = getApplicationContext().getSharedPreferences("react-native", Context.MODE_PRIVATE);
|
||||
- String bugsnagOptOut = settings.getString("bugsnagoptout", "true");
|
||||
-
|
||||
- if (!bugsnagOptOut.equals("true")) {
|
||||
- Bugsnag.start(this, config);
|
||||
- }
|
||||
-
|
||||
SoLoader.init(this, /* native exopackage */ false);
|
||||
|
||||
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
||||
diff --git a/index.js b/index.js
|
||||
index bc0dece..0909408 100644
|
||||
--- a/index.js
|
||||
+++ b/index.js
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'react-native-gesture-handler';
|
||||
-import Bugsnag from '@bugsnag/react-native';
|
||||
import { enableScreens } from 'react-native-screens';
|
||||
import { SNLog } from '@standardnotes/snjs';
|
||||
|
||||
@@ -10,16 +9,8 @@ import { enableAndroidFontFix } from './src/style/android_text_fix';
|
||||
|
||||
enableScreens();
|
||||
|
||||
-if (__DEV__ === false) {
|
||||
- console.log = () => {};
|
||||
- console.warn = () => {};
|
||||
- console.error = () => {};
|
||||
- SNLog.onError = Bugsnag.notify;
|
||||
- SNLog.onLog = Bugsnag.leaveBreadcrumb;
|
||||
-} else {
|
||||
- SNLog.onLog = console.log;
|
||||
- SNLog.onError = console.error;
|
||||
-}
|
||||
+SNLog.onLog = console.log;
|
||||
+SNLog.onError = console.error;
|
||||
|
||||
enableAndroidFontFix();
|
||||
|
||||
diff --git a/package.json b/package.json
|
||||
index 31728ba..dfc27d9 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -18,7 +18,6 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
- "@bugsnag/react-native": "^7.5.6",
|
||||
"@expo/react-native-action-sheet": "^3.8.0",
|
||||
"@react-native-community/async-storage": "1.12.1",
|
||||
"@react-native-community/masked-view": "^0.1.10",
|
||||
@@ -73,7 +72,6 @@
|
||||
"@typescript-eslint/eslint-plugin": "^4.11.1",
|
||||
"@typescript-eslint/parser": "^4.11.1",
|
||||
"babel-jest": "^26.6.3",
|
||||
- "bugsnag-sourcemaps": "^1.3.0",
|
||||
"concurrently": "^5.3.0",
|
||||
"detox": "^17.8.3",
|
||||
"eslint": "^7.10.0",
|
||||
diff --git a/src/App.tsx b/src/App.tsx
|
||||
index 8a7492f..f4ae6e4 100644
|
||||
--- a/src/App.tsx
|
||||
+++ b/src/App.tsx
|
||||
@@ -1,4 +1,3 @@
|
||||
-import Bugsnag from '@bugsnag/react-native';
|
||||
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
||||
import { MobileApplication } from '@Lib/application';
|
||||
import { ApplicationGroup } from '@Lib/application_group';
|
||||
@@ -132,16 +131,6 @@ export const App = (props: { env: 'prod' | 'dev'; bugsnagOptOut: boolean }) => {
|
||||
MobileApplication | undefined
|
||||
>();
|
||||
|
||||
- useEffect(() => {
|
||||
- if (!__DEV__ && !props.bugsnagOptOut) {
|
||||
- try {
|
||||
- Bugsnag.start();
|
||||
- } catch {
|
||||
- console.error('Bugnsag failed to start');
|
||||
- }
|
||||
- }
|
||||
- }, [props.bugsnagOptOut]);
|
||||
-
|
||||
useEffect(() => {
|
||||
const removeAppChangeObserver = applicationGroupRef.current.addApplicationChangeObserver(
|
||||
() => {
|
||||
diff --git a/src/lib/interface.ts b/src/lib/interface.ts
|
||||
index 7d20717..44f5950 100644
|
||||
--- a/src/lib/interface.ts
|
||||
+++ b/src/lib/interface.ts
|
||||
@@ -288,18 +288,7 @@ export class MobileDeviceInterface extends DeviceInterface {
|
||||
}
|
||||
|
||||
async getBugsnagOptedOut() {
|
||||
- try {
|
||||
- /**
|
||||
- * Checking the absense of the 'bugsnagoptout' preference.
|
||||
- * If the value is absent, then error reporting is opt-in by default.
|
||||
- */
|
||||
- const bugsnagOptedOut =
|
||||
- (await DefaultPreference.get(BUGSNAG_OPT_OUT_KEY)) ?? 'true';
|
||||
-
|
||||
- return bugsnagOptedOut === 'true';
|
||||
- } catch {
|
||||
- return true;
|
||||
- }
|
||||
+ return true;
|
||||
}
|
||||
|
||||
setBusgnagOptedOut(optedOut: true | false) {
|
Loading…
Reference in New Issue