@statezero/core 0.1.70 → 0.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/syncEngine/sync.js +1 -26
- package/package.json +1 -1
package/dist/syncEngine/sync.js
CHANGED
|
@@ -293,32 +293,7 @@ export class SyncManager {
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
processModels(event) {
|
|
296
|
-
|
|
297
|
-
if (!registry)
|
|
298
|
-
return;
|
|
299
|
-
// Get the model class for this event
|
|
300
|
-
const modelClass = event.modelClass;
|
|
301
|
-
if (!modelClass)
|
|
302
|
-
return;
|
|
303
|
-
// Get the model store for this model class
|
|
304
|
-
const modelStore = registry.getStore(modelClass);
|
|
305
|
-
if (!modelStore)
|
|
306
|
-
return;
|
|
307
|
-
// Event instances are just PKs - find which ones we have locally
|
|
308
|
-
const eventPks = event.instances || [];
|
|
309
|
-
// Get all currently rendered instances (includes ground truth + operations)
|
|
310
|
-
const renderedInstances = modelStore.render();
|
|
311
|
-
const localPks = new Set(renderedInstances.map((instance) => instance[modelClass.primaryKeyField]));
|
|
312
|
-
const pksToSync = eventPks.filter((pk) => localPks.has(pk));
|
|
313
|
-
if (pksToSync.length === 0) {
|
|
314
|
-
console.log(`[SyncManager] No locally cached instances to sync for ${event.model}`);
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
// Sync only the PKs that are both in the event and locally cached
|
|
318
|
-
console.log(`[SyncManager] Syncing ${pksToSync.length} model instances for ${event.model}`);
|
|
319
|
-
modelStore.sync(pksToSync).catch((error) => {
|
|
320
|
-
console.error(`[SyncManager] Failed to sync model store for ${event.model}:`, error);
|
|
321
|
-
});
|
|
296
|
+
return;
|
|
322
297
|
}
|
|
323
298
|
}
|
|
324
299
|
const syncManager = new SyncManager();
|
package/package.json
CHANGED