@salesforce/lds-runtime-bridge 1.244.0 → 1.245.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.
@@ -5878,30 +5878,36 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
5878
5878
  const operationsWithDenormedRecords = [];
5879
5879
  for (let i = 0, len = operations.length; i < len; i++) {
5880
5880
  const operation = operations[i];
5881
- if (durableStore.plugin !== undefined &&
5882
- durableStore.plugin.supportsBatchUpdates !== undefined &&
5883
- durableStore.plugin.supportsBatchUpdates() === true) {
5884
- if (operation.segment !== DefaultDurableSegment ||
5885
- operation.type !== 'setEntries') {
5886
- operationsWithDenormedRecords.push(operation);
5887
- continue;
5881
+ if (operation.type === 'setMetadata') {
5882
+ // if setMetadata also contains entry data then it needs to be denormalized.
5883
+ const keys$1 = keys(operation.entries);
5884
+ if (keys$1.length > 0) {
5885
+ const firstKey = keys$1[0];
5886
+ // casted to any to check if data exists
5887
+ const firstEntry = operation.entries[firstKey];
5888
+ // it is not possible for setMetadata to contain entries with both data and no data in the same operation.
5889
+ // this is determined by the plugin supporting update batch calls before it gets to this HOF.
5890
+ // so we only need to check one entry to confirm this for performance
5891
+ if (firstEntry.data !== undefined) {
5892
+ operationsWithDenormedRecords.push({
5893
+ ...operation,
5894
+ entries: denormalizeEntries(operation.entries),
5895
+ });
5896
+ }
5897
+ else {
5898
+ operationsWithDenormedRecords.push(operation);
5899
+ }
5888
5900
  }
5889
- operationsWithDenormedRecords.push({
5890
- ...operation,
5891
- entries: denormalizeEntries(operation.entries),
5892
- });
5901
+ continue;
5893
5902
  }
5894
- else {
5895
- if (operation.segment !== DefaultDurableSegment ||
5896
- operation.type === 'evictEntries') {
5897
- operationsWithDenormedRecords.push(operation);
5898
- continue;
5899
- }
5900
- operationsWithDenormedRecords.push({
5901
- ...operation,
5902
- entries: denormalizeEntries(operation.entries),
5903
- });
5903
+ if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
5904
+ operationsWithDenormedRecords.push(operation);
5905
+ continue;
5904
5906
  }
5907
+ operationsWithDenormedRecords.push({
5908
+ ...operation,
5909
+ entries: denormalizeEntries(operation.entries),
5910
+ });
5905
5911
  }
5906
5912
  return durableStore.batchOperations(operationsWithDenormedRecords);
5907
5913
  };
@@ -5992,4 +5998,4 @@ function ldsRuntimeBridge() {
5992
5998
  }
5993
5999
 
5994
6000
  export { ldsRuntimeBridge as default };
5995
- // version: 1.244.0-72e322fff
6001
+ // version: 1.245.0-0ea124370
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-bridge",
3
- "version": "1.244.0",
3
+ "version": "1.245.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for bridge.app.",
6
6
  "main": "dist/ldsRuntimeBridge.js",