MCPcopy Create free account
hub / github.com/instantdb/instant / onResyncError

Method onResyncError

client/packages/core/src/SyncTable.ts:904–918  ·  view source on GitHub ↗
(msg: {
    op: 'error';
    'original-event': ResyncMsg;
    status: number;
    type: string;
  })

Source from the content-addressed store, hash-verified

902 }
903
904 public onResyncError(msg: {
905 op: 'error';
906 'original-event': ResyncMsg;
907 status: number;
908 type: string;
909 }) {
910 // Clear the subscription and start from scrath on any resync error
911 // This can happen if the auth changed and we need to refetch with the
912 // new auth or if the subscription is too far behind.
913 const subscriptionId = msg['original-event']['subscription-id'];
914 const removedSub = this.clearSubscriptionData(subscriptionId, false);
915 if (removedSub) {
916 this.initSubscription(removedSub.query, removedSub.hash);
917 }
918 }
919}

Callers 1

_handleReceiveErrorMethod · 0.80

Calls 2

clearSubscriptionDataMethod · 0.95
initSubscriptionMethod · 0.95

Tested by

no test coverage detected