Skip to content

Commit 889fe7b

Browse files
more debugging (codesandbox#3770)
1 parent 437ad85 commit 889fe7b

File tree

1 file changed

+28
-2
lines changed
  • packages/app/src/app/overmind/effects/live

1 file changed

+28
-2
lines changed

packages/app/src/app/overmind/effects/live/clients.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { logBreadcrumb } from '@codesandbox/common/lib/utils/analytics/sentry';
1+
import {
2+
logBreadcrumb,
3+
captureException,
4+
} from '@codesandbox/common/lib/utils/analytics/sentry';
25
import { Blocker, blocker } from 'app/utils/blocker';
36
import { TextOperation } from 'ot';
47

@@ -66,7 +69,20 @@ export class CodeSandboxOTClient extends OTClient {
6669
})}`,
6770
});
6871

69-
this.safeServerAck(revision);
72+
try {
73+
this.safeServerAck(revision);
74+
} catch (err) {
75+
captureException(
76+
new Error(
77+
`Server Ack ERROR ${JSON.stringify({
78+
moduleShortid: this.moduleShortid,
79+
currentRevision: this.revision,
80+
currentState: this.state.name,
81+
operation,
82+
})}`
83+
)
84+
);
85+
}
7086
})
7187
.catch(error => {
7288
// If an operation errors on the server we will reject
@@ -118,6 +134,16 @@ export class CodeSandboxOTClient extends OTClient {
118134
}
119135

120136
applyServer(operation: TextOperation) {
137+
logBreadcrumb({
138+
category: 'ot',
139+
message: `Apply Server ${JSON.stringify({
140+
moduleShortid: this.moduleShortid,
141+
currentRevision: this.revision,
142+
currentState: this.state.name,
143+
operation,
144+
})}`,
145+
});
146+
121147
super.applyServer(operation);
122148
}
123149

0 commit comments

Comments
 (0)