@shaxpir/duiduidui-models 1.25.10 → 1.25.11

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.
@@ -389,15 +389,28 @@ class ShareSync {
389
389
  // First, try getting the content from the cache
390
390
  const compoundKey = `${kind}/${id}`;
391
391
  if (this._modelCache.has(compoundKey)) {
392
- return this._modelCache.get(compoundKey);
392
+ const cached = this._modelCache.get(compoundKey);
393
+ console.log(`[ShareSync.load] cache hit: ${compoundKey} isDisposed=${cached._isDisposed} acquireCount=${cached.acquireCount}`);
394
+ return cached;
393
395
  }
394
396
  // If not in the cache, get the model doc from the connection.
395
397
  // Then wrap it and put it in the cache for future reference.
396
398
  const doc = this._connection.get(kind, id);
397
399
  if (!doc) {
398
- console.error(`[ShareSync] connection.get(${kind}, ${id}) returned null/undefined doc`);
400
+ console.error(`[ShareSync.load] connection.get(${kind}, ${id}) returned null/undefined doc`);
399
401
  return null;
400
402
  }
403
+ const docAny = doc;
404
+ const docState = {
405
+ hasData: typeof doc.data !== 'undefined',
406
+ version: doc.version,
407
+ type: doc.type ? 'set' : 'null',
408
+ wantsDestroy: docAny._wantsDestroy,
409
+ inflightFetch: docAny.inflightFetch?.length,
410
+ pendingFetch: docAny.pendingFetch?.length,
411
+ hasPending: docAny.hasPending?.(),
412
+ };
413
+ console.log(`[ShareSync.load] cache miss: ${compoundKey} doc=${JSON.stringify(docState)}`);
401
414
  const model = this.wrap(kind, doc, false);
402
415
  this._modelCache.set(compoundKey, model);
403
416
  return model;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.25.10",
3
+ "version": "1.25.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"