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

Method flushPending

client/packages/core/src/SyncTable.ts:593–603  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

591 }
592
593 public async flushPending() {
594 for (const hash of Object.keys(this.callbacks)) {
595 await this.subs.waitForKeyToLoad(hash);
596 const sub = this.subs.currentValue[hash];
597 if (sub) {
598 await this.initSubscription(sub.query, sub.hash);
599 } else {
600 this.log.error('Missing sub for hash in flushPending', hash);
601 }
602 }
603 }
604
605 public onStartSyncOk(msg: StartSyncOkMsg) {
606 const subscriptionId = msg['subscription-id'];

Callers 1

_flushPendingMessagesMethod · 0.80

Calls 3

initSubscriptionMethod · 0.95
waitForKeyToLoadMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected