@salesforce/lds-runtime-mobile 1.243.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.
package/dist/main.js CHANGED
@@ -12481,30 +12481,36 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
12481
12481
  const operationsWithDenormedRecords = [];
12482
12482
  for (let i = 0, len = operations.length; i < len; i++) {
12483
12483
  const operation = operations[i];
12484
- if (durableStore.plugin !== undefined &&
12485
- durableStore.plugin.supportsBatchUpdates !== undefined &&
12486
- durableStore.plugin.supportsBatchUpdates() === true) {
12487
- if (operation.segment !== DefaultDurableSegment ||
12488
- operation.type !== 'setEntries') {
12489
- operationsWithDenormedRecords.push(operation);
12490
- continue;
12484
+ if (operation.type === 'setMetadata') {
12485
+ // if setMetadata also contains entry data then it needs to be denormalized.
12486
+ const keys$1 = keys$3(operation.entries);
12487
+ if (keys$1.length > 0) {
12488
+ const firstKey = keys$1[0];
12489
+ // casted to any to check if data exists
12490
+ const firstEntry = operation.entries[firstKey];
12491
+ // it is not possible for setMetadata to contain entries with both data and no data in the same operation.
12492
+ // this is determined by the plugin supporting update batch calls before it gets to this HOF.
12493
+ // so we only need to check one entry to confirm this for performance
12494
+ if (firstEntry.data !== undefined) {
12495
+ operationsWithDenormedRecords.push({
12496
+ ...operation,
12497
+ entries: denormalizeEntries(operation.entries),
12498
+ });
12499
+ }
12500
+ else {
12501
+ operationsWithDenormedRecords.push(operation);
12502
+ }
12491
12503
  }
12492
- operationsWithDenormedRecords.push({
12493
- ...operation,
12494
- entries: denormalizeEntries(operation.entries),
12495
- });
12504
+ continue;
12496
12505
  }
12497
- else {
12498
- if (operation.segment !== DefaultDurableSegment ||
12499
- operation.type === 'evictEntries') {
12500
- operationsWithDenormedRecords.push(operation);
12501
- continue;
12502
- }
12503
- operationsWithDenormedRecords.push({
12504
- ...operation,
12505
- entries: denormalizeEntries(operation.entries),
12506
- });
12506
+ if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
12507
+ operationsWithDenormedRecords.push(operation);
12508
+ continue;
12507
12509
  }
12510
+ operationsWithDenormedRecords.push({
12511
+ ...operation,
12512
+ entries: denormalizeEntries(operation.entries),
12513
+ });
12508
12514
  }
12509
12515
  return durableStore.batchOperations(operationsWithDenormedRecords);
12510
12516
  };
@@ -17098,6 +17104,7 @@ function getRuntime() {
17098
17104
  getRecords: lazyGetRecords,
17099
17105
  });
17100
17106
  },
17107
+ nimbusSqliteStore: lazyBaseDurableStore,
17101
17108
  };
17102
17109
  }
17103
17110
 
@@ -17114,4 +17121,4 @@ register({
17114
17121
  });
17115
17122
 
17116
17123
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
17117
- // version: 1.243.0-87f38263e
17124
+ // version: 1.245.0-0ea124370
@@ -1,6 +1,7 @@
1
1
  import { Luvio, Environment } from '@luvio/engine';
2
2
  import { DraftManager } from '@salesforce/lds-drafts';
3
3
  import type { DraftQueue } from '@salesforce/lds-drafts';
4
+ import type { NimbusSqliteStore } from '@salesforce/lds-store-nimbus';
4
5
  import type { PrimingSession } from '@salesforce/lds-priming';
5
6
  export interface Runtime {
6
7
  luvio: Luvio;
@@ -12,6 +13,7 @@ export interface Runtime {
12
13
  concurrency?: number;
13
14
  batchSize?: number;
14
15
  }) => PrimingSession;
16
+ nimbusSqliteStore: NimbusSqliteStore;
15
17
  }
16
18
  /**
17
19
  * This returns the LDS on Mobile Runtime singleton object.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.243.0",
3
+ "version": "1.245.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
package/sfdc/main.js CHANGED
@@ -12481,30 +12481,36 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
12481
12481
  const operationsWithDenormedRecords = [];
12482
12482
  for (let i = 0, len = operations.length; i < len; i++) {
12483
12483
  const operation = operations[i];
12484
- if (durableStore.plugin !== undefined &&
12485
- durableStore.plugin.supportsBatchUpdates !== undefined &&
12486
- durableStore.plugin.supportsBatchUpdates() === true) {
12487
- if (operation.segment !== DefaultDurableSegment ||
12488
- operation.type !== 'setEntries') {
12489
- operationsWithDenormedRecords.push(operation);
12490
- continue;
12484
+ if (operation.type === 'setMetadata') {
12485
+ // if setMetadata also contains entry data then it needs to be denormalized.
12486
+ const keys$1 = keys$3(operation.entries);
12487
+ if (keys$1.length > 0) {
12488
+ const firstKey = keys$1[0];
12489
+ // casted to any to check if data exists
12490
+ const firstEntry = operation.entries[firstKey];
12491
+ // it is not possible for setMetadata to contain entries with both data and no data in the same operation.
12492
+ // this is determined by the plugin supporting update batch calls before it gets to this HOF.
12493
+ // so we only need to check one entry to confirm this for performance
12494
+ if (firstEntry.data !== undefined) {
12495
+ operationsWithDenormedRecords.push({
12496
+ ...operation,
12497
+ entries: denormalizeEntries(operation.entries),
12498
+ });
12499
+ }
12500
+ else {
12501
+ operationsWithDenormedRecords.push(operation);
12502
+ }
12491
12503
  }
12492
- operationsWithDenormedRecords.push({
12493
- ...operation,
12494
- entries: denormalizeEntries(operation.entries),
12495
- });
12504
+ continue;
12496
12505
  }
12497
- else {
12498
- if (operation.segment !== DefaultDurableSegment ||
12499
- operation.type === 'evictEntries') {
12500
- operationsWithDenormedRecords.push(operation);
12501
- continue;
12502
- }
12503
- operationsWithDenormedRecords.push({
12504
- ...operation,
12505
- entries: denormalizeEntries(operation.entries),
12506
- });
12506
+ if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
12507
+ operationsWithDenormedRecords.push(operation);
12508
+ continue;
12507
12509
  }
12510
+ operationsWithDenormedRecords.push({
12511
+ ...operation,
12512
+ entries: denormalizeEntries(operation.entries),
12513
+ });
12508
12514
  }
12509
12515
  return durableStore.batchOperations(operationsWithDenormedRecords);
12510
12516
  };
@@ -17098,6 +17104,7 @@ function getRuntime() {
17098
17104
  getRecords: lazyGetRecords,
17099
17105
  });
17100
17106
  },
17107
+ nimbusSqliteStore: lazyBaseDurableStore,
17101
17108
  };
17102
17109
  }
17103
17110
 
@@ -17114,4 +17121,4 @@ register({
17114
17121
  });
17115
17122
 
17116
17123
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
17117
- // version: 1.243.0-87f38263e
17124
+ // version: 1.245.0-0ea124370
@@ -1,6 +1,7 @@
1
1
  import { Luvio, Environment } from '@luvio/engine';
2
2
  import { DraftManager } from '@salesforce/lds-drafts';
3
3
  import type { DraftQueue } from '@salesforce/lds-drafts';
4
+ import type { NimbusSqliteStore } from '@salesforce/lds-store-nimbus';
4
5
  import type { PrimingSession } from '@salesforce/lds-priming';
5
6
  export interface Runtime {
6
7
  luvio: Luvio;
@@ -12,6 +13,7 @@ export interface Runtime {
12
13
  concurrency?: number;
13
14
  batchSize?: number;
14
15
  }) => PrimingSession;
16
+ nimbusSqliteStore: NimbusSqliteStore;
15
17
  }
16
18
  /**
17
19
  * This returns the LDS on Mobile Runtime singleton object.