@omegup/msync 0.1.20 → 0.1.21

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/index.esm.js CHANGED
@@ -1637,7 +1637,6 @@ let running = false;
1637
1637
  const loop = async (db) => {
1638
1638
  log('starting oplog loop');
1639
1639
  for await (const { ns, fields, doc } of tailOplog(db, {})) {
1640
- log('oplog event', ns, doc.op, [...fields]);
1641
1640
  const m = watchers.get(ns);
1642
1641
  if (!m)
1643
1642
  continue;
@@ -1863,7 +1862,7 @@ const executes$2 = (view, input, streamName, skip = false, after, needs = {}) =>
1863
1862
  log('teardown done', `db['${snapshotCollection.collectionName}'].drop()`, ...out);
1864
1863
  };
1865
1864
  if (!same) {
1866
- log('not same, new data', data);
1865
+ log('not same, new data', streamName, data);
1867
1866
  await handleTeardown(exists ?? { data });
1868
1867
  }
1869
1868
  await after?.();
@@ -1952,8 +1951,8 @@ const executes$2 = (view, input, streamName, skip = false, after, needs = {}) =>
1952
1951
  job: null,
1953
1952
  },
1954
1953
  };
1955
- if (l.ts)
1956
- patch.$set = data;
1954
+ if (l.first)
1955
+ patch.$set = { ...patch.$set, data };
1957
1956
  await last.updateOne({ _id: streamName }, patch, { upsert: true });
1958
1957
  log('updated __last', Date.now() - start, `db['${last.collectionName}'].updateOne({ _id: '${streamName}' }, `, patch, `, { upsert: true })`);
1959
1958
  return step8(l);
package/index.js CHANGED
@@ -1639,7 +1639,6 @@ let running = false;
1639
1639
  const loop = async (db) => {
1640
1640
  log('starting oplog loop');
1641
1641
  for await (const { ns, fields, doc } of tailOplog(db, {})) {
1642
- log('oplog event', ns, doc.op, [...fields]);
1643
1642
  const m = watchers.get(ns);
1644
1643
  if (!m)
1645
1644
  continue;
@@ -1865,7 +1864,7 @@ const executes$2 = (view, input, streamName, skip = false, after, needs = {}) =>
1865
1864
  log('teardown done', `db['${snapshotCollection.collectionName}'].drop()`, ...out);
1866
1865
  };
1867
1866
  if (!same) {
1868
- log('not same, new data', data);
1867
+ log('not same, new data', streamName, data);
1869
1868
  await handleTeardown(exists ?? { data });
1870
1869
  }
1871
1870
  await after?.();
@@ -1954,8 +1953,8 @@ const executes$2 = (view, input, streamName, skip = false, after, needs = {}) =>
1954
1953
  job: null,
1955
1954
  },
1956
1955
  };
1957
- if (l.ts)
1958
- patch.$set = data;
1956
+ if (l.first)
1957
+ patch.$set = { ...patch.$set, data };
1959
1958
  await last.updateOne({ _id: streamName }, patch, { upsert: true });
1960
1959
  log('updated __last', Date.now() - start, `db['${last.collectionName}'].updateOne({ _id: '${streamName}' }, `, patch, `, { upsert: true })`);
1961
1960
  return step8(l);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "index.esm.js",
4
4
  "typings": "index.d.ts",
5
5
  "name": "@omegup/msync",
6
- "version": "0.1.20",
6
+ "version": "0.1.21",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",