Skip to content
Source
Sign inSign up
TanStack/db

Fix error propagation from sync clients to collections #671

ClosedKyleAMathews(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromelectric-errorsopened

Showing 9 changed files with 24 additions and 10 deletions (loading 6).

x
0 of 9 viewed, 9 left
0 additions and 0 deletions.beads/electric-error-propegate.dbAdded
View file

Binary file not shown.

9 additions and 9 deletionspackages/db/src/collection/index.tsModified
View file
@@ -215,7 +215,7 @@
public utils: Record<string, Fn> = {}
​
// Managers
- private _events: CollectionEventsManager
+ public events: CollectionEventsManager
Thread on line 218

the manager classes are intended to be a private api, but have to be public so that they can see each other, and we can introspect them from tests. This should change it to public, but maintain the underscore on the name.

The "public" face of the events api is a set of methods on the Collection class itself that forward to this manager.

  public _events: CollectionEventsManager
private _changes: CollectionChangesManager<TOutput, TKey, TSchema, TInput>
private _lifecycle: CollectionLifecycleManager<TOutput, TKey, TSchema, TInput>
private _sync: CollectionSyncManager<TOutput, TKey, TSchema, TInput>
@@ -261,7 +261,7 @@