@salesforce/lds-utils-adapters 1.310.0 → 1.311.1

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.
@@ -26,6 +26,7 @@ function runAdapterWithReport(adapterName, adapter, adapterConfig, requestContex
26
26
  let networkStart;
27
27
  let networkEnd;
28
28
  let staleLookup = false;
29
+ let cacheLookupState = undefined;
29
30
  let result;
30
31
  let snapshotState = '';
31
32
  let error;
@@ -189,14 +190,17 @@ function runAdapterWithReport(adapterName, adapter, adapterConfig, requestContex
189
190
  // L2 cache hit
190
191
  result = 'l2-hit';
191
192
  }
193
+ cacheLookupState = ev.snapshotState;
192
194
  if (ev.snapshotState === 'Stale') {
193
195
  staleLookup = true;
194
196
  }
195
197
  break;
196
198
  case 'network-lookup-start':
197
- // if the lookup is stale, the network lookup is
198
- // caused by an async refresh
199
- if (staleLookup === false) {
199
+ // if the lookup is stale or fulfilled it wasnt a cache miss
200
+ // but refreshed due to explicitly being asked (cache-and-network) or because it was stale
201
+ if (cacheLookupState &&
202
+ cacheLookupState !== 'Stale' &&
203
+ cacheLookupState !== 'Fulfilled') {
200
204
  result = 'cache-miss';
201
205
  networkStart = Date.now();
202
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-utils-adapters",
3
- "version": "1.310.0",
3
+ "version": "1.311.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS Adapter Utilities",
6
6
  "main": "dist/ldsAdapterUtils.js",