@salesforce/lds-runtime-bridge 1.237.0 → 1.239.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.
@@ -1370,10 +1370,17 @@ class NimbusSqliteStore {
1370
1370
  }
1371
1371
  setMetadata(entries, segment) {
1372
1372
  const table = this.getTable(segment);
1373
- const operation = this.plugin.supportsBatchUpdates === undefined ||
1374
- this.plugin.supportsBatchUpdates() === false
1375
- ? table.entriesToUpsertOperations(entries, segment)
1376
- : table.metadataToUpdateOperations(entries, segment);
1373
+ let operation;
1374
+ if (this.plugin.supportsBatchUpdates === undefined ||
1375
+ this.plugin.supportsBatchUpdates() === false) {
1376
+ operation = table.entriesToUpsertOperations(entries, segment);
1377
+ // manually set the context type on the upsert so notifications do not notify rebuilds without
1378
+ // plugin updates
1379
+ operation.context.type = 'setMetadata';
1380
+ }
1381
+ else {
1382
+ operation = table.metadataToUpdateOperations(entries, segment);
1383
+ }
1377
1384
  return this.batchOperationAsPromise([operation]);
1378
1385
  }
1379
1386
  batchOperations(operations) {
@@ -1386,7 +1393,11 @@ class NimbusSqliteStore {
1386
1393
  const table = this.getTable(cur.segment);
1387
1394
  if (this.plugin.supportsBatchUpdates === undefined ||
1388
1395
  this.plugin.supportsBatchUpdates() === false) {
1389
- acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
1396
+ const upsert = table.entriesToUpsertOperations(cur.entries, cur.segment);
1397
+ // manually set the context type on the upsert so notifications do not notify rebuilds without
1398
+ // plugin updates
1399
+ upsert.context.type = 'setMetadata';
1400
+ acc.push(upsert);
1390
1401
  }
1391
1402
  else {
1392
1403
  acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
@@ -1412,7 +1423,8 @@ class NimbusSqliteStore {
1412
1423
  // if our context contains a type then set that as our main level type
1413
1424
  // allows us in the future of updates to specify the segment change happening
1414
1425
  // example being update call on metadata only or updating data
1415
- if (c.type === 'update' && c.context.type !== undefined) {
1426
+ if ((c.type === 'update' || c.type === 'upsert') &&
1427
+ c.context.type !== undefined) {
1416
1428
  type = c.context.type;
1417
1429
  }
1418
1430
  return {
@@ -5993,4 +6005,4 @@ function ldsRuntimeBridge() {
5993
6005
  }
5994
6006
 
5995
6007
  export { ldsRuntimeBridge as default };
5996
- // version: 1.237.0-5cc894ce9
6008
+ // version: 1.239.0-6c531185a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-bridge",
3
- "version": "1.237.0",
3
+ "version": "1.239.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for bridge.app.",
6
6
  "main": "dist/ldsRuntimeBridge.js",