Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
461f3d4
initial bugsnag setup
IlarionHalushka Aug 1, 2019
a4ef2ce
upload sourcemaps to bugsnag during ios-build job
IlarionHalushka Aug 1, 2019
8da4d47
fix: spacing in config.yml
IlarionHalushka Aug 1, 2019
a0b98d0
add yarn global add react-native
IlarionHalushka Aug 1, 2019
59f3e61
add separate step: Upload sourcemaps to Bugsnag
IlarionHalushka Aug 1, 2019
1f5d672
add brew install watchman
IlarionHalushka Aug 1, 2019
0789a58
install react-native-cli, remove install watchman
IlarionHalushka Aug 1, 2019
9c2e79a
upload source maps for android build
IlarionHalushka Aug 2, 2019
2f8043d
add yarn add global react-native react-native-cli for android-build c…
IlarionHalushka Aug 2, 2019
f4bb743
add working_directory to android-build
IlarionHalushka Aug 2, 2019
69c5740
install npm i -g react-native react-native-cli
IlarionHalushka Aug 2, 2019
ac38f7f
add Install Node step to android-build job
IlarionHalushka Aug 2, 2019
d984cfc
export path to node to bash_profile
IlarionHalushka Aug 2, 2019
e47c27e
add step Install React Native CLI to android build job
IlarionHalushka Aug 2, 2019
015e70c
use yarn generate-source-maps in ci; exchange firebase log -> bugsnag…
IlarionHalushka Aug 3, 2019
165f934
implement send(toggle) crash reports button
IlarionHalushka Aug 6, 2019
5c1fa8d
move BUGSNAG_API_KEY to config file; remove generated source maps files
IlarionHalushka Aug 7, 2019
987f6ee
unlink bugsnag
IlarionHalushka Aug 8, 2019
59a40de
Merge branch 'develop' into chore-add-bugsnag
IlarionHalushka Aug 11, 2019
0754531
Merge branch 'develop' into chore-add-bugsnag
IlarionHalushka Aug 11, 2019
697413e
add ios/Pods files connected to Bugsnag; fix ci android build job
IlarionHalushka Aug 11, 2019
f10cfd3
Merge branch 'develop' into chore-add-bugsnag
IlarionHalushka Aug 19, 2019
d71a28c
export firebase analytics also from /utils/log
IlarionHalushka Aug 19, 2019
9e59e2e
use `log(e)` instead of `log(error)`
IlarionHalushka Aug 19, 2019
4a48454
API Key changes
diegolmello Aug 22, 2019
a75134b
pod install
diegolmello Aug 22, 2019
f8e1e10
Fix iOS build
diegolmello Aug 22, 2019
9f284ae
Merge branch 'develop' into chore-add-bugsnag
diegolmello Aug 22, 2019
7a869b6
Merge branch 'develop' into chore-add-bugsnag
diegolmello Aug 22, 2019
5dc2d2f
Simulate error
diegolmello Aug 22, 2019
3e14a9c
Merge branch 'develop' into chore-add-bugsnag
diegolmello Aug 22, 2019
fcfc706
lint
diegolmello Aug 22, 2019
2c7c4c8
Add navigation
diegolmello Aug 22, 2019
1903cad
Use projectRoot
diegolmello Aug 22, 2019
0090a72
Revert project root
diegolmello Aug 22, 2019
68da169
Merge branch 'develop' into chore-add-bugsnag
diegolmello Aug 22, 2019
e8c1ded
- Don't run on forks
diegolmello Aug 22, 2019
1cb1b90
Remove error sim
diegolmello Aug 23, 2019
43cfa47
Remove automatic dSYMs upload
diegolmello Aug 23, 2019
c5cfbfa
Remove fastlane-plugin-bugsnag
diegolmello Aug 23, 2019
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
56 changes: 54 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,26 @@ jobs:
steps:
- checkout

- run:
name: Install Node 8
command: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
source ~/.nvm/nvm.sh
# https://github.com/creationix/nvm/issues/1394
set +e
nvm install 8
echo 'export PATH="/home/circleci/.nvm/versions/node/v8.16.0/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

- restore_cache:
name: Restore NPM cache
key: node-modules-{{ checksum "yarn.lock" }}

- run:
name: Install React Native CLI
command: |
npm i -g react-native-cli

- run:
name: Install NPM modules
command: |
Expand Down Expand Up @@ -148,12 +164,32 @@ jobs:
fi

echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties
echo -e "BugsnagAPIKey=$BUGSNAG_KEY" >> ./gradle.properties

- run:
name: Set Google Services
command: |
cd android/app
cp google-services.prod.json google-services.json
working_directory: android/app

- run:
name: Upload sourcemaps to Bugsnag
command: |
if [[ $BUGSNAG_KEY ]]; then
yarn generate-source-maps-android
curl https://upload.bugsnag.com/react-native-source-map \
-F apiKey=$BUGSNAG_KEY \
-F appVersionCode=$CIRCLE_BUILD_NUM \
-F dev=false \
-F platform=android \
-F sourceMap=@android-release.bundle.map \
-F bundle=@android-release.bundle
fi

- run:
name: Config variables
command: |
echo -e "export default { BUGSNAG_API_KEY: '$BUGSNAG_KEY' };" > ./config.js

- run:
name: Build Android App
Expand Down Expand Up @@ -215,6 +251,7 @@ jobs:
- run:
name: Install NPM modules
command: |
yarn global add react-native react-native-cli
yarn

- run:
Expand All @@ -229,11 +266,26 @@ jobs:
cp GoogleService-Info.prod.plist GoogleService-Info.plist
working_directory: ios

- run:
name: Upload sourcemaps to Bugsnag
command: |
if [[ $BUGSNAG_KEY ]]; then
yarn generate-source-maps-ios
curl https://upload.bugsnag.com/react-native-source-map \
-F apiKey=$BUGSNAG_KEY \
-F appBundleVersion=$CIRCLE_BUILD_NUM \
-F dev=false \
-F platform=ios \
-F sourceMap=@ios-release.bundle.map \
-F bundle=@ios-release.bundle
fi

- run:
name: Fastlane Build
no_output_timeout: 1200
command: |
agvtool new-version -all $CIRCLE_BUILD_NUM
/usr/libexec/PlistBuddy -c "Set BugsnagAPIKey $BUGSNAG_KEY" ./RocketChatRN/Info.plist

if [[ $MATCH_KEYCHAIN_NAME ]]; then
bundle exec fastlane ios release
Expand Down Expand Up @@ -288,7 +340,7 @@ jobs:
- run:
name: Fastlane Tesflight Upload
command: |
bundle exec fastlane pilot upload --ipa ios/RocketChatRN.ipa --changelog "$(sh ../.circleci/changelog.sh)"
bundle exec fastlane ios beta
working_directory: ios

- save_cache:
Expand Down
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: "com.android.application"
apply plugin: "io.fabric"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: 'com.bugsnag.android.gradle'

import com.android.build.OutputFile

Expand Down Expand Up @@ -137,6 +138,7 @@ android {
versionCode VERSIONCODE as Integer
versionName "1.19.0"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
}

signingConfigs {
Expand Down
5 changes: 4 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
Expand Down Expand Up @@ -52,6 +52,9 @@
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<meta-data
android:name="com.bugsnag.android.API_KEY"
android:value="${BugsnagAPIKey}" />
</application>

</manifest>
27 changes: 14 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ buildscript {
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.1'
classpath 'com.google.firebase:perf-plugin:1.2.1'
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:4.+'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -50,16 +51,16 @@ allprojects {
}
}

// subprojects { subproject ->
// afterEvaluate {
// if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
// android {
// compileSdkVersion 28
// buildToolsVersion "28.0.3"
// defaultConfig {
// targetSdkVersion 28
// }
// }
// }
// }
// }
// subprojects { subproject ->
// afterEvaluate {
// if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
// android {
// compileSdkVersion 28
// buildToolsVersion "28.0.3"
// defaultConfig {
// targetSdkVersion 28
// }
// }
// }
// }
// }
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ org.gradle.jvmargs=-Xmx2048M -XX\:MaxHeapSize\=32g
android.useAndroidX=true
android.enableJetifier=true
VERSIONCODE=999999999
BugsnagAPIKey=""
1 change: 1 addition & 0 deletions app/ReactotronConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ if (__DEV__) {
Reactotron.clear();
console.warn = Reactotron.log;
console.log = Reactotron.log;
console.disableYellowBox = true;
}
1 change: 1 addition & 0 deletions app/actions/actionsTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN']);
export const SORT_PREFERENCES = createRequestTypes('SORT_PREFERENCES', ['SET_ALL', 'SET']);
export const NOTIFICATION = createRequestTypes('NOTIFICATION', ['RECEIVED', 'REMOVE']);
export const TOGGLE_MARKDOWN = 'TOGGLE_MARKDOWN';
export const TOGGLE_CRASH_REPORT = 'TOGGLE_CRASH_REPORT';
8 changes: 8 additions & 0 deletions app/actions/crashReport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as types from './actionsTypes';

export function toggleCrashReport(value) {
return {
type: types.TOGGLE_CRASH_REPORT,
payload: value
};
}
4 changes: 2 additions & 2 deletions app/containers/MessageActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class MessageActions extends React.Component {
await RocketChat.reportMessage(actionMessage._id);
Alert.alert(I18n.t('Message_Reported'));
} catch (err) {
log('err_report_message', err);
log(err);
}
}

Expand All @@ -328,7 +328,7 @@ class MessageActions extends React.Component {
await RocketChat.translateMessage(actionMessage, room.autoTranslateLanguage);
}
} catch (err) {
log('err_toggle_translation', err);
log(err);
}
}

Expand Down
12 changes: 6 additions & 6 deletions app/containers/MessageBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ class MessageBox extends Component {
try {
database.create('users', user, true);
} catch (e) {
log('err_create_users', e);
log(e);
}
});
});
Expand Down Expand Up @@ -504,7 +504,7 @@ class MessageBox extends Component {
try {
await RocketChat.sendFileMessage(rid, fileInfo, tmid, server, user);
} catch (e) {
log('err_send_media_message', e);
log(e);
}
}

Expand All @@ -513,7 +513,7 @@ class MessageBox extends Component {
const image = await ImagePicker.openCamera(this.imagePickerConfig);
this.showUploadModal(image);
} catch (e) {
log('err_take_photo', e);
log(e);
}
}

Expand All @@ -522,7 +522,7 @@ class MessageBox extends Component {
const video = await ImagePicker.openCamera(this.videoPickerConfig);
this.showUploadModal(video);
} catch (e) {
log('err_take_video', e);
log(e);
}
}

Expand All @@ -531,7 +531,7 @@ class MessageBox extends Component {
const image = await ImagePicker.openPicker(this.libraryPickerConfig);
this.showUploadModal(image);
} catch (e) {
log('err_choose_from_library', e);
log(e);
}
}

Expand Down Expand Up @@ -618,7 +618,7 @@ class MessageBox extends Component {
if (e && e.error === 'error-file-too-large') {
return Alert.alert(I18n.t(e.error));
}
log('err_finish_audio_message', e);
log(e);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,5 +407,5 @@ export default {
Version_no: 'Version: {{version}}',
You_will_not_be_able_to_recover_this_message: 'You will not be able to recover this message!',
Change_Language: 'Change Language',
Crash_report_disclaimer: 'We never track the content of your chats. The crash report only contains relevant information for us in order '
Crash_report_disclaimer: 'We never track the content of your chats. The crash report only contains relevant information for us in order to identify problems and fix it.'
};
14 changes: 14 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import { initializePushNotifications, onNotification } from './notifications/pus
import store from './lib/createStore';
import NotificationBadge from './notifications/inApp';
import { defaultHeader, onNavigationStateChange } from './utils/navigation';
import { loggerConfig, analytics } from './utils/log';
import Toast from './containers/Toast';
import RocketChat from './lib/rocketchat';

useScreens();

Expand Down Expand Up @@ -256,6 +258,7 @@ export default class Root extends React.Component {
constructor(props) {
super(props);
this.init();
this.initCrashReport();
}

componentDidMount() {
Expand Down Expand Up @@ -285,6 +288,17 @@ export default class Root extends React.Component {
}
}

initCrashReport = () => {
RocketChat.getAllowCrashReport()
.then((allowCrashReport) => {
if (!allowCrashReport) {
loggerConfig.autoNotify = false;
loggerConfig.registerBeforeSendCallback(() => false);
analytics().setAnalyticsCollectionEnabled(false);
}
});
}

render() {
return (
<Provider store={store}>
Expand Down
4 changes: 2 additions & 2 deletions app/lib/methods/getCustomEmojis.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function() {
database.delete(emojiRecord);
}
} catch (e) {
log('err_get_emojis_delete', e);
log(e);
}
});
}
Expand All @@ -77,7 +77,7 @@ export default function() {
);
}
} catch (e) {
log('err_get_custom_emojis', e);
log(e);
return resolve();
}
});
Expand Down
6 changes: 3 additions & 3 deletions app/lib/methods/getPermissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const create = (permissions) => {
try {
database.create('permissions', permission, true);
} catch (e) {
log('err_get_permissions_create', e);
log(e);
}
});
}
Expand Down Expand Up @@ -65,7 +65,7 @@ export default function() {
database.delete(permission);
}
} catch (e) {
log('err_get_permissions_delete', e);
log(e);
}
});
}
Expand All @@ -74,7 +74,7 @@ export default function() {
);
}
} catch (e) {
log('err_get_permissions', e);
log(e);
return resolve();
}
});
Expand Down
4 changes: 2 additions & 2 deletions app/lib/methods/getRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export default function() {
try {
database.create('roles', role, true);
} catch (e) {
log('err_get_roles_create', e);
log(e);
}
}));
return resolve();
});
}
} catch (e) {
log('err_get_roles', e);
log(e);
return resolve();
}
});
Expand Down
Loading