@salesforce/lds-runtime-bridge 1.273.1 → 1.275.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.
@@ -301,7 +301,7 @@ class DurableTTLStore {
301
301
  }
302
302
  }
303
303
 
304
- function flushInMemoryStoreValuesToDurableStore(store, durableStore, crossEnvironmentNotifier, durableStoreErrorHandler, redirects, additionalDurableStoreOperations = [], enableDurableMetadataRefresh = false) {
304
+ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler, redirects, additionalDurableStoreOperations = [], enableDurableMetadataRefresh = false) {
305
305
  const durableRecords = create$3(null);
306
306
  const refreshedDurableRecords = create$3(null);
307
307
  const evictedRecords = create$3(null);
@@ -329,7 +329,10 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, crossEnviro
329
329
  const entries = wasVisited === true || enableDurableMetadataRefresh === false
330
330
  ? durableRecords
331
331
  : refreshedDurableRecords;
332
- setRecordTo(entries, key, record, metadata);
332
+ const isMetadataRefresh = entries === refreshedDurableRecords;
333
+ setRecordTo(entries, key,
334
+ // dont send record data with metadata refresh
335
+ isMetadataRefresh ? undefined : record, metadata);
333
336
  }
334
337
  const durableStoreOperations = additionalDurableStoreOperations;
335
338
  const recordKeys = keys$3(durableRecords);
@@ -341,21 +344,14 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, crossEnviro
341
344
  segment: DefaultDurableSegment,
342
345
  });
343
346
  }
344
- if (keys$3(refreshedDurableRecords).length > 0) {
347
+ const refreshKeys = keys$3(refreshedDurableRecords);
348
+ if (refreshKeys.length > 0) {
345
349
  // publishes with only metadata updates
346
350
  durableStoreOperations.push({
347
351
  type: 'setMetadata',
348
352
  entries: refreshedDurableRecords,
349
353
  segment: DefaultDurableSegment,
350
354
  });
351
- if (crossEnvironmentNotifier !== undefined) {
352
- crossEnvironmentNotifier.notifyCrossEnvironments({
353
- data: {
354
- refreshedDurableRecords,
355
- },
356
- type: 'Update',
357
- });
358
- }
359
355
  }
360
356
  // redirects
361
357
  redirects.forEach((value, key) => {
@@ -657,14 +653,17 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
657
653
  }
658
654
  // process metadata only refreshes
659
655
  if (metadataRefreshSegmentKeys.length > 0) {
660
- const entries = await durableStore.getMetadata(metadataRefreshSegmentKeys, DefaultDurableSegment);
661
- if (entries !== undefined) {
662
- const entryKeys = keys$3(entries);
663
- for (let i = 0, len = entryKeys.length; i < len; i++) {
664
- const entryKey = entryKeys[i];
665
- const { metadata } = entries[entryKey];
666
- if (metadata !== undefined) {
667
- environment.putStoreMetadata(entryKey, metadata, false);
656
+ const filteredKeys = metadataRefreshSegmentKeys.filter((s) => environment.storeKeyExists(s));
657
+ if (filteredKeys.length > 0) {
658
+ const entries = await durableStore.getMetadata(filteredKeys, DefaultDurableSegment);
659
+ if (entries !== undefined) {
660
+ const entryKeys = keys$3(entries);
661
+ for (let i = 0, len = entryKeys.length; i < len; i++) {
662
+ const entryKey = entryKeys[i];
663
+ const { metadata } = entries[entryKey];
664
+ if (metadata !== undefined) {
665
+ environment.putStoreMetadata(entryKey, metadata, false);
666
+ }
668
667
  }
669
668
  }
670
669
  }
@@ -687,15 +686,6 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
687
686
  }
688
687
  }
689
688
  });
690
- let notifier;
691
- const getCrossEnvironmentNotifier = function () {
692
- validateNotDisposed();
693
- return notifier;
694
- };
695
- const setCrossEnvironmentNotifier = function (crossEnvironmentNotifier) {
696
- validateNotDisposed();
697
- notifier = crossEnvironmentNotifier;
698
- };
699
689
  const dispose = function () {
700
690
  validateNotDisposed();
701
691
  disposed = true;
@@ -748,7 +738,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
748
738
  if (stagingStore === null) {
749
739
  return Promise.resolve();
750
740
  }
751
- const promise = flushInMemoryStoreValuesToDurableStore(stagingStore, durableStore, getCrossEnvironmentNotifier(), durableStoreErrorHandler, new Map(pendingStoreRedirects), additionalDurableStoreOperations, enableDurableMetadataRefresh);
741
+ const promise = flushInMemoryStoreValuesToDurableStore(stagingStore, durableStore, durableStoreErrorHandler, new Map(pendingStoreRedirects), additionalDurableStoreOperations, enableDurableMetadataRefresh);
752
742
  pendingStoreRedirects.clear();
753
743
  stagingStore = null;
754
744
  return promise;
@@ -1118,8 +1108,6 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
1118
1108
  handleErrorResponse: { value: handleErrorResponse },
1119
1109
  getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
1120
1110
  notifyStoreUpdateAvailable: { value: notifyStoreUpdateAvailable },
1121
- getCrossEnvironmentNotifier: { value: getCrossEnvironmentNotifier },
1122
- setCrossEnvironmentNotifier: { value: setCrossEnvironmentNotifier },
1123
1111
  });
1124
1112
  }
1125
1113
 
@@ -3030,11 +3018,7 @@ function findFieldInfo(objectInfo, fieldName) {
3030
3018
  }
3031
3019
  async function readIngestionTimestampForKey(key, query) {
3032
3020
  let ingestionTimestamp = 0;
3033
- const sql = `
3034
- SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}')
3035
- FROM lds_data
3036
- WHERE key IS ?
3037
- `;
3021
+ const sql = `SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}') FROM lds_data WHERE key IS ?`;
3038
3022
  const results = await query(sql, [key]);
3039
3023
  const [timestamp] = results.rows.map((row) => row[0]);
3040
3024
  if (timestamp !== null) {
@@ -3042,9 +3026,7 @@ async function readIngestionTimestampForKey(key, query) {
3042
3026
  if (isNaN(numericalTimestamp)) {
3043
3027
  return ingestionTimestamp;
3044
3028
  }
3045
- // adjust the timestamp to account for ingestion processing time
3046
- // 30s is used because this is the default record TTL
3047
- ingestionTimestamp = numericalTimestamp - 30000;
3029
+ ingestionTimestamp = numericalTimestamp;
3048
3030
  }
3049
3031
  return ingestionTimestamp;
3050
3032
  }
@@ -4010,4 +3992,4 @@ function ldsRuntimeBridge() {
4010
3992
  }
4011
3993
 
4012
3994
  export { ldsRuntimeBridge as default };
4013
- // version: 1.273.1-37fe48f59
3995
+ // version: 1.275.0-c8b3e2f72
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-bridge",
3
- "version": "1.273.1",
3
+ "version": "1.275.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for bridge.app.",
6
6
  "main": "dist/ldsRuntimeBridge.js",
@@ -34,17 +34,17 @@
34
34
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-bridge"
35
35
  },
36
36
  "dependencies": {
37
- "@salesforce/lds-adapters-uiapi": "^1.273.1",
38
- "@salesforce/lds-instrumentation": "^1.273.1",
37
+ "@salesforce/lds-adapters-uiapi": "^1.275.0",
38
+ "@salesforce/lds-instrumentation": "^1.275.0",
39
39
  "@salesforce/user": "0.0.21",
40
40
  "o11y": "244.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@salesforce/lds-drafts-adapters-uiapi": "^1.273.1",
44
- "@salesforce/lds-network-aura": "^1.273.1",
45
- "@salesforce/lds-runtime-aura": "^1.273.1",
46
- "@salesforce/lds-store-nimbus": "^1.273.1",
47
- "@salesforce/nimbus-plugin-lds": "^1.273.1",
43
+ "@salesforce/lds-drafts-adapters-uiapi": "^1.275.0",
44
+ "@salesforce/lds-network-aura": "^1.275.0",
45
+ "@salesforce/lds-runtime-aura": "^1.275.0",
46
+ "@salesforce/lds-store-nimbus": "^1.275.0",
47
+ "@salesforce/nimbus-plugin-lds": "^1.275.0",
48
48
  "babel-plugin-dynamic-import-node": "^2.3.3"
49
49
  },
50
50
  "luvioBundlesize": [