Skip to content

Commit 5cadff3

Browse files
committed
refactor: remove legacy update error hook
1 parent 5bbf825 commit 5cadff3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/loro-adaptors/src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ export interface CrdtDocAdaptor {
5050
errorCode: number,
5151
reason?: string
5252
) => void;
53-
// Legacy hook retained for compatibility
54-
handleUpdateError?: (error: unknown) => void;
5553
destroy: () => void;
5654
}
5755

packages/loro-websocket/src/client/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,8 +1490,8 @@ class LoroWebsocketClientRoomImpl
14901490
try {
14911491
this.crdtAdaptor.applyUpdate(updates);
14921492
} catch (error) {
1493-
// Surface to adaptor for custom handling
1494-
this.crdtAdaptor.handleUpdateError?.(error);
1493+
// Surface failure for visibility and inform server about invalid batch
1494+
console.error("Failed to apply remote update", error);
14951495
// Inform server that the update failed if we can reference the batch ID
14961496
if (refId && this.client.socket?.readyState === WebSocket.OPEN) {
14971497
try {

0 commit comments

Comments
 (0)