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

[FIX] Analytics error events #930

Merged
merged 1 commit into from
May 28, 2019
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 app/containers/MessageActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default class MessageActions extends React.Component {
await RocketChat.reportMessage(actionMessage._id);
Alert.alert(I18n.t('Message_Reported'));
} catch (err) {
log('report message', err);
log('err_report_message', err);
}
}

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

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

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

Expand Down Expand Up @@ -492,7 +492,7 @@ class MessageBox extends Component {
if (e && e.error === 'error-file-too-large') {
return Alert.alert(I18n.t(e.error));
}
log('finishAudioMessage', e);
log('err_finish_audio_message', e);
}
}
}
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 @@ -66,14 +66,14 @@ export default async function() {
database.delete(emojiRecord);
}
} catch (e) {
log('getEmojis delete', e);
log('err_get_emojis_delete', e);
}
});
}
})
);
}
} catch (e) {
log('getCustomEmojis', e);
log('err_get_custom_emojis', e);
}
}
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('getPermissions create', e);
log('err_get_permissions_create', e);
}
});
}
Expand Down Expand Up @@ -63,14 +63,14 @@ export default async function() {
database.delete(permission);
}
} catch (e) {
log('getPermissions delete', e);
log('err_get_permissions_delete', e);
}
});
}
})
);
}
} catch (e) {
log('getPermissions', e);
log('err_get_permissions', e);
}
}
4 changes: 2 additions & 2 deletions app/lib/methods/getRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export default async function() {
try {
database.create('roles', role, true);
} catch (e) {
log('getRoles create', e);
log('err_get_roles_create', e);
}
}));
});
}
} catch (e) {
log('getRoles', e);
log('err_get_roles', e);
}
}
6 changes: 3 additions & 3 deletions app/lib/methods/getSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function updateServer(param) {
try {
database.databases.serversDB.create('servers', { id: reduxStore.getState().server.server, ...param }, true);
} catch (e) {
log('updateServer', e);
log('err_get_settings_update_server', e);
}
});
}
Expand All @@ -34,7 +34,7 @@ export default async function() {
try {
database.create('settings', { ...setting, _updatedAt: new Date() }, true);
} catch (e) {
log('create settings', e);
log('err_get_settings_create', e);
}

if (setting._id === 'Site_Name') {
Expand All @@ -52,6 +52,6 @@ export default async function() {
updateServer.call(this, { iconURL });
}
} catch (e) {
log('getSettings', e);
log('err_get_settings', e);
}
}
4 changes: 2 additions & 2 deletions app/lib/methods/loadMessagesForRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function loadMessagesForRoom(...args) {
database.create('threadMessages', message, true);
}
} catch (e) {
log('loadMessagesForRoom -> create messages', e);
log('err_load_messages_for_room_create', e);
}
}));
return resolve(data);
Expand All @@ -61,7 +61,7 @@ export default function loadMessagesForRoom(...args) {
return resolve([]);
}
} catch (e) {
log('loadMessagesForRoom', e);
log('err_load_messages_for_room', e);
reject(e);
}
});
Expand Down
6 changes: 3 additions & 3 deletions app/lib/methods/loadMissedMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function loadMissedMessages(...args) {
database.create('threadMessages', message, true);
}
} catch (e) {
log('loadMissedMessages -> create messages', e);
log('err_load_missed_messages_create', e);
}
}));
});
Expand All @@ -65,14 +65,14 @@ export default function loadMissedMessages(...args) {
});
});
} catch (e) {
log('loadMissedMessages -> delete message', e);
log('err_load_missed_messages_delete', e);
}
});
}
}
resolve();
} catch (e) {
log('loadMissedMessages', e);
log('err_load_missed_messages', e);
reject(e);
}
});
Expand Down
4 changes: 2 additions & 2 deletions app/lib/methods/loadThreadMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function loadThreadMessages({ tmid, offset = 0 }) {
message.rid = tmid;
database.create('threadMessages', message, true);
} catch (e) {
log('loadThreadMessages -> create messages', e);
log('err_load_thread_messages_create', e);
}
}));
return resolve(data);
Expand All @@ -43,7 +43,7 @@ export default function loadThreadMessages({ tmid, offset = 0 }) {
return resolve([]);
}
} catch (e) {
log('loadThreadMessages', e);
log('err_load_thread_messages', e);
reject(e);
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/lib/methods/readMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export default async function readMessages(rid) {
});
return data;
} catch (e) {
log('readMessages', e);
log('err_read_messages', e);
}
}
8 changes: 4 additions & 4 deletions app/lib/methods/sendFileMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
try {
database.create('uploads', fileInfo, true);
} catch (e) {
return log('sendFileMessage -> create uploads 1', e);
return log('err_send_file_message_create_upload_1', e);
}
});

Expand All @@ -69,7 +69,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
try {
database.create('uploads', fileInfo, true);
} catch (e) {
return log('sendFileMessage -> create uploads 2', e);
return log('err_send_file_message_create_upload_2', e);
}
});
});
Expand All @@ -95,7 +95,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
try {
database.delete(upload);
} catch (e) {
log('sendFileMessage -> delete uploads', e);
log('err_send_file_message_delete_upload', e);
}
});
} catch (e) {
Expand All @@ -104,7 +104,7 @@ export async function sendFileMessage(rid, fileInfo, tmid) {
try {
database.create('uploads', fileInfo, true);
} catch (err) {
log('sendFileMessage -> create uploads 3', err);
log('err_send_file_message_create_upload_3', err);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/methods/sendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ export default async function(rid, msg, tmid) {
});
}
} catch (e) {
log('sendMessage', e);
log('err_send_message', e);
}
}
6 changes: 3 additions & 3 deletions app/lib/methods/subscriptions/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function subscribeRoom({ rid }) {
typingTimeouts[username] = null;
}
} catch (error) {
console.log('TCL: removeUserTyping -> error', error);
log('err_remove_user_typing', error);
}
};

Expand All @@ -85,7 +85,7 @@ export default function subscribeRoom({ rid }) {
removeUserTyping(username);
}, 10000);
} catch (error) {
console.log('TCL: addUserTyping -> error', error);
log('err_add_user_typing', error);
}
}
};
Expand Down Expand Up @@ -198,7 +198,7 @@ export default function subscribeRoom({ rid }) {
try {
promises = this.sdk.subscribeRoom(rid);
} catch (e) {
log('subscribeRoom', e);
log('err_subscribe_room', e);
}

return {
Expand Down
12 changes: 6 additions & 6 deletions app/lib/methods/subscriptions/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default async function subscribeRooms() {
database.delete(subscription);
});
} catch (e) {
log('handleStreamMessageReceived -> subscriptions removed', e);
log('err_stream_msg_received_sub_removed', e);
}
} else {
const rooms = database.objects('rooms').filtered('_id == $0', data.rid);
Expand All @@ -70,7 +70,7 @@ export default async function subscribeRooms() {
database.delete(rooms);
});
} catch (e) {
log('handleStreamMessageReceived -> subscriptions updated', e);
log('err_stream_msg_received_sub_updated', e);
}
}
}
Expand All @@ -83,15 +83,15 @@ export default async function subscribeRooms() {
database.create('subscriptions', tmp, true);
});
} catch (e) {
log('handleStreamMessageReceived -> rooms updated', e);
log('err_stream_msg_received_room_updated', e);
}
} else if (type === 'inserted') {
try {
database.write(() => {
database.create('rooms', data, true);
});
} catch (e) {
log('handleStreamMessageReceived -> rooms inserted', e);
log('err_stream_msg_received_room_inserted', e);
}
}
}
Expand All @@ -116,7 +116,7 @@ export default async function subscribeRooms() {
database.create('messages', message, true);
});
} catch (e) {
log('handleStreamMessageReceived -> message', e);
log('err_stream_msg_received_message', e);
}
});
}
Expand Down Expand Up @@ -146,7 +146,7 @@ export default async function subscribeRooms() {
try {
await this.sdk.subscribeNotifyUser();
} catch (e) {
log('subscribeRooms', e);
log('err_subscribe_rooms', e);
}

return {
Expand Down
6 changes: 3 additions & 3 deletions app/lib/rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const RocketChat = {
return result;
}
} catch (e) {
log('getServerInfo', e);
log('err_get_server_info', e);
}
return {
success: false,
Expand Down Expand Up @@ -387,7 +387,7 @@ const RocketChat = {
database.create('messages', message, true);
});
} catch (e) {
log('resendMessage error', e);
log('err_resend_message', e);
}
}
},
Expand Down Expand Up @@ -514,7 +514,7 @@ const RocketChat = {
try {
room = await RocketChat.getRoom(message.rid);
} catch (e) {
log('Rocketchat.getPermalink', e);
log('err_get_permalink', e);
return null;
}
const { server } = reduxStore.getState().server;
Expand Down
2 changes: 1 addition & 1 deletion app/sagas/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const restore = function* restore() {

yield put(actions.appReady({}));
} catch (e) {
log('restore', e);
log('err_restore', e);
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/sagas/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const handleLogout = function* handleLogout() {
yield put(appStart('outside'));
} catch (e) {
yield put(appStart('outside'));
log('handleLogout', e);
log('err_handle_logout', e);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion app/sagas/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const handleReplyBroadcast = function* handleReplyBroadcast({ message }) {
yield delay(500);
yield put(replyInit(message, false));
} catch (e) {
log('handleReplyBroadcast', e);
log('err_reply_broadcast', e);
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/sagas/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const watchUserTyping = function* watchUserTyping({ rid, status }) {
yield RocketChat.emitTyping(rid, false);
}
} catch (e) {
log('watchUserTyping', e);
log('err_watch_user_typing', e);
}
};

Expand Down
Loading