diff --git a/patches/@absinthe+socket+0.2.1.patch b/patches/@absinthe+socket+0.2.1.patch index 0eced580c..7a7a07496 100644 --- a/patches/@absinthe+socket+0.2.1.patch +++ b/patches/@absinthe+socket+0.2.1.patch @@ -171,7 +171,7 @@ index 9e5f12d..2c38c75 100644 const onTimeout = (absintheSocket, notifier) => notifierNotifyActive( diff --git a/node_modules/@absinthe/socket/src/subscription.js b/node_modules/@absinthe/socket/src/subscription.js -index de44085..0b46b29 100644 +index de44085..1abe8c1 100644 --- a/node_modules/@absinthe/socket/src/subscription.js +++ b/node_modules/@absinthe/socket/src/subscription.js @@ -7,6 +7,7 @@ import type { @@ -182,12 +182,18 @@ index de44085..0b46b29 100644 import abortNotifier from "./abortNotifier"; import notifierFind from "./notifier/find"; -@@ -143,6 +144,9 @@ const onDataMessage = ( +@@ -143,6 +144,15 @@ const onDataMessage = ( if (notifier) { notifierNotifyResultEvent(notifier, payload.result); } + else { -+ notifyBugsnag(new Error('Subscription not found'), 'absinthe_socket_subscription_error', payload) ++ notifyBugsnag(new Error('Subscription not found'), ++ 'absinthe_socket_subscription_error', ++ { ++ payload, ++ notifiers: absintheSocket.notifiers, ++ } ++ ) + } }; diff --git a/src/store/FirebaseStore.ts b/src/store/FirebaseStore.ts index 314b793c8..56a1127a4 100644 --- a/src/store/FirebaseStore.ts +++ b/src/store/FirebaseStore.ts @@ -111,8 +111,7 @@ const FirebaseStore = types // NOTE: this is not a MST action async function processFirebaseAuthChange(user: any) { - log('FIREBASESTORE: AUTH STATE CHANGED', !!user) - log(user) + log('FIREBASESTORE: AUTH STATE CHANGED', user) if (user) { try { await auth!.currentUser!.reload() diff --git a/third-party/wocky-client/src/actionLogger.ts b/third-party/wocky-client/src/actionLogger.ts index 089429db6..c01f2f78f 100644 --- a/third-party/wocky-client/src/actionLogger.ts +++ b/third-party/wocky-client/src/actionLogger.ts @@ -1,15 +1,14 @@ import {getPath, IMiddlewareEvent} from 'mobx-state-tree' +import {log} from '../../../src/utils/logger' // Based off https://github.com/mobxjs/mobx-state-tree/blob/master/packages/mst-middlewares/src/simple-action-logger.ts export function actionLogger(call: IMiddlewareEvent, next: (call: IMiddlewareEvent) => void) { if (call.type === 'action' && call.parentId === 0) { const base = '[MST] ' + getPath(call.context) + '/' + call.name if (call.args.length === 0) { - // tslint:disable-next-line - console.log(base) + log(base) } else { - // tslint:disable-next-line - console.log(base + ' args:', call.args) + log(base + ' args:', call.args) } } return next(call) diff --git a/third-party/wocky-client/src/transport/Transport.ts b/third-party/wocky-client/src/transport/Transport.ts index be84bbd5e..aae9b603f 100644 --- a/third-party/wocky-client/src/transport/Transport.ts +++ b/third-party/wocky-client/src/transport/Transport.ts @@ -10,6 +10,7 @@ import {IProfilePartial, FriendShareTypeEnum, IFriendShareConfig} from '../model import {ILocationSnapshot, IBotPost} from '..' import {IBot, IBotIn} from '../model/Bot' import {ILocation} from '../model/Location' +import {notifyBugsnag} from '../../../../src/utils/logger' const introspectionQueryResultData = require('./fragmentTypes.json') const TIMEOUT = 10000 @@ -1367,7 +1368,10 @@ export class Transport { res = await this.mutate({mutation, variables}) if (res.data && !res.data![name].successful) { // console.error('voidMutation error with ', name, JSON.stringify(res.data[name])) - throw new Error(`GraphQL ${name} error: ${JSON.stringify(res.data![name])}`) + notifyBugsnag( + new Error(`GraphQL ${name} error: ${JSON.stringify(res.data![name])}`), + `graphql_${name}_error` + ) } }