File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
packages/app/src/app/overmind Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { TextOperation } from 'ot';
1010import { Socket , Channel } from 'phoenix' ;
1111import uuid from 'uuid' ;
1212
13+ import { logBreadcrumb } from '@codesandbox/common/lib/utils/analytics/sentry' ;
1314import clientsFactory from './clients' ;
1415import { OPTIMISTIC_ID_PREFIX } from '../utils' ;
1516
@@ -44,12 +45,22 @@ export default new (class Live {
4445 const live = this ;
4546
4647 clients = clientsFactory (
47- ( moduleShortid , revision , operation ) =>
48- live . send ( 'operation' , {
48+ ( moduleShortid , revision , operation ) => {
49+ logBreadcrumb ( {
50+ type : 'ot' ,
51+ message : `Sending ${ JSON . stringify ( {
52+ moduleShortid,
53+ revision,
54+ operation,
55+ } ) } `,
56+ } ) ;
57+
58+ return live . send ( 'operation' , {
4959 moduleShortid,
5060 operation,
5161 revision,
52- } ) ,
62+ } ) ;
63+ } ,
5364 ( moduleShortid , operation ) => {
5465 options . onApplyOperation ( {
5566 moduleShortid,
@@ -143,6 +154,11 @@ export default new (class Live {
143154 data && data . _messageId && sentMessages . delete ( data . _messageId )
144155 ) ;
145156
157+ if ( event === 'phx_reply' || event . startsWith ( 'chan_reply_' ) ) {
158+ // No action listens to this
159+ return data ;
160+ }
161+
146162 action ( {
147163 event : alteredEvent ,
148164 _isOwnMessage,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { NotificationStatus } from '@codesandbox/notifications/lib/state';
1111import { Operator } from 'app/overmind' ;
1212import { camelizeKeys } from 'humps' ;
1313import { json , mutate } from 'overmind' ;
14+ import { logError } from '@codesandbox/common/lib/utils/analytics' ;
1415
1516export const onJoin : Operator < LiveMessage < {
1617 status : 'connected' ;
@@ -490,6 +491,9 @@ export const onOperation: Operator<LiveMessage<{
490491 } catch ( e ) {
491492 // Something went wrong, probably a sync mismatch. Request new version
492493 console . error ( 'Something went wrong with applying OT operation' ) ;
494+
495+ logError ( e ) ;
496+
493497 effects . live . sendModuleStateSyncRequest ( ) ;
494498 }
495499 }
You can’t perform that action at this time.
0 commit comments