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';
10
10
import { Socket , Channel } from 'phoenix' ;
11
11
import uuid from 'uuid' ;
12
12
13
+ import { logBreadcrumb } from '@codesandbox/common/lib/utils/analytics/sentry' ;
13
14
import clientsFactory from './clients' ;
14
15
import { OPTIMISTIC_ID_PREFIX } from '../utils' ;
15
16
@@ -44,12 +45,22 @@ export default new (class Live {
44
45
const live = this ;
45
46
46
47
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' , {
49
59
moduleShortid,
50
60
operation,
51
61
revision,
52
- } ) ,
62
+ } ) ;
63
+ } ,
53
64
( moduleShortid , operation ) => {
54
65
options . onApplyOperation ( {
55
66
moduleShortid,
@@ -143,6 +154,11 @@ export default new (class Live {
143
154
data && data . _messageId && sentMessages . delete ( data . _messageId )
144
155
) ;
145
156
157
+ if ( event === 'phx_reply' || event . startsWith ( 'chan_reply_' ) ) {
158
+ // No action listens to this
159
+ return data ;
160
+ }
161
+
146
162
action ( {
147
163
event : alteredEvent ,
148
164
_isOwnMessage,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { NotificationStatus } from '@codesandbox/notifications/lib/state';
11
11
import { Operator } from 'app/overmind' ;
12
12
import { camelizeKeys } from 'humps' ;
13
13
import { json , mutate } from 'overmind' ;
14
+ import { logError } from '@codesandbox/common/lib/utils/analytics' ;
14
15
15
16
export const onJoin : Operator < LiveMessage < {
16
17
status : 'connected' ;
@@ -490,6 +491,9 @@ export const onOperation: Operator<LiveMessage<{
490
491
} catch ( e ) {
491
492
// Something went wrong, probably a sync mismatch. Request new version
492
493
console . error ( 'Something went wrong with applying OT operation' ) ;
494
+
495
+ logError ( e ) ;
496
+
493
497
effects . live . sendModuleStateSyncRequest ( ) ;
494
498
}
495
499
}
You can’t perform that action at this time.
0 commit comments