@luvio/environments 0.154.1 → 0.154.4

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.
@@ -282,21 +282,27 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
282
282
  const durableRecords = create(null);
283
283
  const refreshedDurableRecords = create(null);
284
284
  const evictedRecords = create(null);
285
- const { records, metadata: storeMetadata, visitedIds, refreshedIds, } = store.fallbackStringKeyInMemoryStore;
285
+ const { visitedIds, refreshedIds } = store.fallbackStringKeyInMemoryStore;
286
286
  // TODO: W-8909393 Once metadata is stored in its own segment we need to
287
287
  // call setEntries for the visitedIds on default segment and call setEntries
288
288
  // on the metadata segment for the refreshedIds
289
289
  const keys$1 = keys({ ...visitedIds, ...refreshedIds });
290
290
  for (let i = 0, len = keys$1.length; i < len; i += 1) {
291
291
  const key = keys$1[i];
292
- const record = records[key];
292
+ const canonicalKey = store.getCanonicalRecordId(key);
293
+ // this record has been redirected, evict the original
294
+ if (canonicalKey !== key) {
295
+ evictedRecords[key] = true;
296
+ continue;
297
+ }
298
+ const record = store.readEntry(key);
293
299
  const wasVisited = visitedIds[key] !== undefined;
294
300
  // this record has been evicted, evict from DS
295
301
  if (wasVisited && record === undefined) {
296
302
  evictedRecords[key] = true;
297
303
  continue;
298
304
  }
299
- const metadata = storeMetadata[key];
305
+ const metadata = store.readMetadata(key);
300
306
  const entries = wasVisited === true || enableDurableMetadataRefresh === false
301
307
  ? durableRecords
302
308
  : refreshedDurableRecords;
@@ -730,17 +736,17 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
730
736
  };
731
737
  const getNode = function (key) {
732
738
  validateNotDisposed();
733
- if (stagingStore === null) {
734
- stagingStore = buildIngestStagingStore(environment);
739
+ if (stagingStore !== null) {
740
+ return environment.getNode(key, stagingStore);
735
741
  }
736
- return environment.getNode(key, stagingStore);
742
+ return environment.getNode(key);
737
743
  };
738
744
  const wrapNormalizedGraphNode = function (normalized, key) {
739
745
  validateNotDisposed();
740
- if (stagingStore === null) {
741
- stagingStore = buildIngestStagingStore(environment);
746
+ if (stagingStore !== null) {
747
+ return environment.wrapNormalizedGraphNode(normalized, key, stagingStore);
742
748
  }
743
- return environment.wrapNormalizedGraphNode(normalized, key, stagingStore);
749
+ return environment.wrapNormalizedGraphNode(normalized, key);
744
750
  };
745
751
  const rebuildSnapshot = function (snapshot, onRebuild) {
746
752
  validateNotDisposed();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luvio/environments",
3
- "version": "0.154.1",
3
+ "version": "0.154.4",
4
4
  "description": "Luvio Environments",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "watch": "yarn build --watch"
28
28
  },
29
29
  "dependencies": {
30
- "@luvio/engine": "^0.154.1"
30
+ "@luvio/engine": "^0.154.4"
31
31
  },
32
32
  "volta": {
33
33
  "extends": "../../../package.json"