@salesforce/lds-instrumentation 1.309.0 → 1.311.0

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.
@@ -141,6 +141,7 @@ function runAdapterWithReport(adapterName, adapter, adapterConfig, requestContex
141
141
  let networkStart;
142
142
  let networkEnd;
143
143
  let staleLookup = false;
144
+ let cacheLookupState = undefined;
144
145
  let result;
145
146
  let snapshotState = '';
146
147
  let error;
@@ -304,14 +305,17 @@ function runAdapterWithReport(adapterName, adapter, adapterConfig, requestContex
304
305
  // L2 cache hit
305
306
  result = 'l2-hit';
306
307
  }
308
+ cacheLookupState = ev.snapshotState;
307
309
  if (ev.snapshotState === 'Stale') {
308
310
  staleLookup = true;
309
311
  }
310
312
  break;
311
313
  case 'network-lookup-start':
312
- // if the lookup is stale, the network lookup is
313
- // caused by an async refresh
314
- if (staleLookup === false) {
314
+ // if the lookup is stale or fulfilled it wasnt a cache miss
315
+ // but refreshed due to explicitly being asked (cache-and-network) or because it was stale
316
+ if (cacheLookupState &&
317
+ cacheLookupState !== 'Stale' &&
318
+ cacheLookupState !== 'Fulfilled') {
315
319
  result = 'cache-miss';
316
320
  networkStart = Date.now();
317
321
  }
@@ -1564,4 +1568,4 @@ function onIdleDetected(callback) {
1564
1568
  const instrumentation = new Instrumentation();
1565
1569
 
1566
1570
  export { Instrumentation, LRUCache, metricKeys as METRIC_KEYS, executeAsyncActivity, handleIngestedNewData, handleOnDataOutOfTtlDurationUpdate, incrementCounterMetric, incrementGetRecordNormalInvokeCount, incrementGetRecordNotifyChangeAllowCount, incrementGetRecordNotifyChangeDropCount, incrementNotifyRecordUpdateAvailableAllowCount, incrementNotifyRecordUpdateAvailableDropCount, instrumentAdapter, instrumentLuvio, instrumentMethods, instrumentStoreMethods, instrumentation, logError, logObjectInfoChanged, onIdleDetected, setInstrumentationHooks, setLdsAdaptersUiapiInstrumentation, setLdsNetworkAdapterInstrumentation, setStoreEventObservers, setupInstrumentation, startAdapterActivity, updatePercentileHistogramMetric };
1567
- // version: 1.309.0-e7611a7fb5
1571
+ // version: 1.311.0-167623b638
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-instrumentation",
3
- "version": "1.309.0",
3
+ "version": "1.311.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "Instrumentation utils for Lightning Data Service",
6
6
  "main": "dist/ldsInstrumentation.js",
@@ -33,17 +33,17 @@
33
33
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-instrumentation"
34
34
  },
35
35
  "dependencies": {
36
- "@salesforce/lds-bindings": "^1.309.0",
37
- "@salesforce/lds-default-luvio": "^1.309.0",
38
- "@salesforce/lds-utils-adapters": "^1.309.0",
36
+ "@salesforce/lds-bindings": "^1.311.0",
37
+ "@salesforce/lds-default-luvio": "^1.311.0",
38
+ "@salesforce/lds-utils-adapters": "^1.311.0",
39
39
  "o11y": "250.7.0",
40
40
  "o11y_schema": "248.40.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@salesforce/lds-adapters-uiapi": "^1.309.0",
44
- "@salesforce/lds-adapters-uiapi-mobile": "^1.309.0",
45
- "@salesforce/lds-network-adapter": "^1.309.0",
46
- "@salesforce/nimbus-plugin-lds": "^1.309.0"
43
+ "@salesforce/lds-adapters-uiapi": "^1.311.0",
44
+ "@salesforce/lds-adapters-uiapi-mobile": "^1.311.0",
45
+ "@salesforce/lds-network-adapter": "^1.311.0",
46
+ "@salesforce/nimbus-plugin-lds": "^1.311.0"
47
47
  },
48
48
  "luvioBundlesize": [
49
49
  {