diff --git a/app/redux/TransactionSaga.js b/app/redux/TransactionSaga.js index e75b2bd..68a75c9 100644 --- a/app/redux/TransactionSaga.js +++ b/app/redux/TransactionSaga.js @@ -144,12 +144,13 @@ function* broadcastOperation( } } yield call(broadcastPayload, {payload}) - let eventType = type.replace(/^([a-z])/, g => g.toUpperCase()).replace(/_([a-z])/g, g => g[1].toUpperCase()); - if (eventType === 'Comment' && !op.parent_author) eventType = 'Post'; - const page = eventType === 'Vote' ? `@${op.author}/${op.permlink}` : ''; - serverApiRecordEvent(eventType, page); } catch(error) { console.error('TransactionSaga', error) + try { + serverApiRecordEvent('node_error/tx', JSON.stringify(operations) + ' ||| ' + error.toString()) + } catch (err2) { + console.error('Cannot record tx error event:', err2) + } if(errorCallback) errorCallback(error.toString()) } } @@ -222,6 +223,12 @@ function* broadcastPayload({payload: {operations, keys, username, hideErrors, su console.error('TransactionSaga\tbroadcast', error) // status: error + try { + serverApiRecordEvent('node_error/tx_broadcast', JSON.stringify(operations) + ' ||| ' + error.toString()) + } catch (err2) { + console.error('Cannot record tx broadcast error event:', err2) + } + yield put(tr.actions.error({operations, error, hideErrors, errorCallback})) for (const [type, operation] of operations) { diff --git a/server/api/general.js b/server/api/general.js index 8e5b148..9a96a4e 100644 --- a/server/api/general.js +++ b/server/api/general.js @@ -76,7 +76,6 @@ export default function useGeneralApi(app) { const params = ctx.request.body; const {csrf, type, value} = typeof(params) === 'string' ? JSON.parse(params) : params; if (!ctx.checkCSRF(csrf)) return; - console.log('-- /record_event -->', ctx.session.uid, type, value); const str_value = typeof value === 'string' ? value : JSON.stringify(value); recordWebEvent(ctx, type, str_value); ctx.body = JSON.stringify({status: 'ok'}); diff --git a/server/record_web_event.js b/server/record_web_event.js index 78ec96e..da2203b 100644 --- a/server/record_web_event.js +++ b/server/record_web_event.js @@ -1,2 +1,3 @@ export default function recordWebEvent(ctx, event_type, value) { + console.log('-- /record_event -->', event_type, value) }