fix: broadcast the change after all inserts #1

Open
opened 2026-01-28 12:52:33 +00:00 by kodemon · 0 comments
Owner

Currently the broadcast happens before the index has been updated, this can cause desync where new queries are triggered before all the new data has been finalized.

for (const document of documents) {
this.#index.insert(document);
}

Currently the broadcast happens before the index has been updated, this can cause desync where new queries are triggered before all the new data has been finalized. https://git.valkyrjs.com/kodemon/db/src/commit/53b43f625367005fbe5782c2eae7a40062f41284/src/databases/indexeddb/storage.ts#L83-L85
kodemon self-assigned this 2026-01-28 12:52:33 +00:00
kodemon added the Kind/Enhancement
Reviewed
Confirmed
1
labels 2026-01-28 12:53:41 +00:00
Sign in to join this conversation.