@salesforce/lds-ads-bridge 1.309.0-dev15 → 1.309.0-dev17
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/ads-bridge-perf.js +49 -11
- package/dist/adsBridge.js +1 -1
- package/package.json +3 -3
package/dist/ads-bridge-perf.js
CHANGED
|
@@ -433,7 +433,7 @@ function createResourceParamsImpl(config, configMetadata) {
|
|
|
433
433
|
}
|
|
434
434
|
return resourceParams;
|
|
435
435
|
}
|
|
436
|
-
// engine version: 0.156.4-
|
|
436
|
+
// engine version: 0.156.4-dev2-78889b7e
|
|
437
437
|
|
|
438
438
|
/**
|
|
439
439
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -481,7 +481,7 @@ const callbacks$1 = [];
|
|
|
481
481
|
function register(r) {
|
|
482
482
|
callbacks$1.forEach((callback) => callback(r));
|
|
483
483
|
}
|
|
484
|
-
// version: 1.309.0-
|
|
484
|
+
// version: 1.309.0-dev17-5357fa694b
|
|
485
485
|
|
|
486
486
|
/**
|
|
487
487
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -7573,7 +7573,7 @@ const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS = {
|
|
|
7573
7573
|
version: RECORD_REPRESENTATION_ERROR_VERSION,
|
|
7574
7574
|
};
|
|
7575
7575
|
function isGraphNode$1(node) {
|
|
7576
|
-
return node
|
|
7576
|
+
return !!node && node.type === 'Node';
|
|
7577
7577
|
}
|
|
7578
7578
|
function addScalarFieldId(current) {
|
|
7579
7579
|
addScalarField(current, 'Id');
|
|
@@ -7640,6 +7640,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
7640
7640
|
const spanning = spanningLink.follow();
|
|
7641
7641
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
7642
7642
|
if (isExternalLookupFieldKey(spanning)) {
|
|
7643
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
7644
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
7643
7645
|
continue;
|
|
7644
7646
|
}
|
|
7645
7647
|
extractTrackedFieldsToTrie(spanningLink.data.__ref, spanning, next, config, spanningVisitedRecordIds, depth + 1);
|
|
@@ -7672,6 +7674,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
7672
7674
|
const { fields } = state;
|
|
7673
7675
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
7674
7676
|
if (includes.call(fields, 'ExternalId')) {
|
|
7677
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
7678
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
7675
7679
|
continue;
|
|
7676
7680
|
}
|
|
7677
7681
|
for (let s = 0, len = fields.length; s < len; s += 1) {
|
|
@@ -7883,15 +7887,49 @@ function isSuperRecordFieldTrie(a, b) {
|
|
|
7883
7887
|
|
|
7884
7888
|
// This function sets fields that we are refreshing to pending
|
|
7885
7889
|
// These values will go into the store
|
|
7886
|
-
function mergePendingFields(newRecord, oldRecord) {
|
|
7887
|
-
// TODO [W-6900046]: avoid casting to any by updating
|
|
7888
|
-
// RecordRepresentationNormalized['fields'] to include `pending:true` property
|
|
7890
|
+
function mergePendingFields(newRecord, oldRecord, existingNode) {
|
|
7889
7891
|
const mergedFields = { ...newRecord.fields };
|
|
7890
7892
|
const merged = { ...newRecord, fields: mergedFields };
|
|
7891
7893
|
const existingFields = keys$1(oldRecord.fields);
|
|
7892
7894
|
for (let i = 0, len = existingFields.length; i < len; i += 1) {
|
|
7893
7895
|
const spanningFieldName = existingFields[i];
|
|
7894
7896
|
if (newRecord.fields[spanningFieldName] === undefined) {
|
|
7897
|
+
/*
|
|
7898
|
+
* Per W-8058425 external lookups fields are excluded from the tracked fields. However, as covered in
|
|
7899
|
+
* W-11899329, situations can arise in which a merge conflict occurs when the existing record has a
|
|
7900
|
+
* reference to an external lookup field. The exclusion ultimately results in a snapshot stuck in the
|
|
7901
|
+
* pending state. This is an approach to prevent that situation.
|
|
7902
|
+
*
|
|
7903
|
+
* The same logic checks for W-8058425 to "continue" as it relates to not tracking external lookups is
|
|
7904
|
+
* mimicked here as it relates to not marking them as pending.
|
|
7905
|
+
*/
|
|
7906
|
+
// make sure external lookups are NOT marked as pending when `existingNode` is provided
|
|
7907
|
+
if (isGraphNode$1(existingNode)) {
|
|
7908
|
+
// get the node for the spanning field
|
|
7909
|
+
const fieldValueRep = existingNode
|
|
7910
|
+
.object('fields')
|
|
7911
|
+
.link(spanningFieldName);
|
|
7912
|
+
const field = fieldValueRep.follow();
|
|
7913
|
+
if (isGraphNode$1(field)) {
|
|
7914
|
+
if (field.isScalar('value') === false) {
|
|
7915
|
+
const record = field
|
|
7916
|
+
.link('value')
|
|
7917
|
+
.follow();
|
|
7918
|
+
if (isExternalLookupFieldKey(record)) {
|
|
7919
|
+
continue;
|
|
7920
|
+
}
|
|
7921
|
+
}
|
|
7922
|
+
}
|
|
7923
|
+
else {
|
|
7924
|
+
const state = fieldValueRep.linkData();
|
|
7925
|
+
if (state !== undefined) {
|
|
7926
|
+
const { fields } = state;
|
|
7927
|
+
if (includes.call(fields, 'ExternalId')) {
|
|
7928
|
+
continue;
|
|
7929
|
+
}
|
|
7930
|
+
}
|
|
7931
|
+
}
|
|
7932
|
+
}
|
|
7895
7933
|
// TODO [W-6900046]: fix above casting issue so we're not stuffing arbitrary things
|
|
7896
7934
|
// into RecordRepresentationNormalized['fields']
|
|
7897
7935
|
mergedFields[spanningFieldName] = {
|
|
@@ -7905,7 +7943,7 @@ function mergePendingFields(newRecord, oldRecord) {
|
|
|
7905
7943
|
// This method gets called
|
|
7906
7944
|
// when incoming record has a higher version
|
|
7907
7945
|
// than the record that is currently in the store
|
|
7908
|
-
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
7946
|
+
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
7909
7947
|
// If the higher version (incoming) does not contain a superset of fields as existing
|
|
7910
7948
|
// then we need to refresh to get updated versions of fields in existing
|
|
7911
7949
|
if (isSuperRecordFieldTrie(incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot) ===
|
|
@@ -7922,14 +7960,14 @@ function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedF
|
|
|
7922
7960
|
};
|
|
7923
7961
|
// We want to mark fields in the store as pending
|
|
7924
7962
|
// Because we don't want to emit any data to components
|
|
7925
|
-
return mergePendingFields(incoming, existing);
|
|
7963
|
+
return mergePendingFields(incoming, existing, existingNode);
|
|
7926
7964
|
}
|
|
7927
7965
|
return incoming;
|
|
7928
7966
|
}
|
|
7929
7967
|
// This method gets called
|
|
7930
7968
|
// when incoming record has a lower version
|
|
7931
7969
|
// than the record that is currently in the store
|
|
7932
|
-
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
7970
|
+
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
7933
7971
|
// If the higher version (existing) does not have a superset of fields as incoming
|
|
7934
7972
|
// then we need to refresh to get updated versions of fields on incoming
|
|
7935
7973
|
if (isSuperRecordFieldTrie(existingTrackedFieldsTrieRoot, incomingTrackedFieldsTrieRoot) ===
|
|
@@ -7939,7 +7977,7 @@ function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTr
|
|
|
7939
7977
|
if (isSupportedEntity(incoming.apiName) === false) {
|
|
7940
7978
|
return mergeRecordFields(existing, incoming);
|
|
7941
7979
|
}
|
|
7942
|
-
const merged = mergePendingFields(existing, incoming);
|
|
7980
|
+
const merged = mergePendingFields(existing, incoming, existingNode);
|
|
7943
7981
|
// update the conflict map to resolve the record conflict in resolveConflict
|
|
7944
7982
|
if (recordConflictMap) {
|
|
7945
7983
|
recordConflictMap.conflicts[incoming.id] = {
|
|
@@ -7978,7 +8016,7 @@ function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
|
|
|
7978
8016
|
extractTrackedFieldsToTrie(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
7979
8017
|
extractTrackedFieldsToTrie(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
7980
8018
|
if (incoming.weakEtag > existing.weakEtag) {
|
|
7981
|
-
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
8019
|
+
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode);
|
|
7982
8020
|
}
|
|
7983
8021
|
return mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
7984
8022
|
}
|
package/dist/adsBridge.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-ads-bridge",
|
|
3
|
-
"version": "1.309.0-
|
|
3
|
+
"version": "1.309.0-dev17",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "Bridge to sync data between LDS and ADS",
|
|
6
6
|
"main": "dist/adsBridge.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-ads-bridge"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@salesforce/lds-adapters-uiapi": "^1.309.0-
|
|
34
|
-
"@salesforce/lds-uiapi-record-utils-mobile": "^1.309.0-
|
|
33
|
+
"@salesforce/lds-adapters-uiapi": "^1.309.0-dev17",
|
|
34
|
+
"@salesforce/lds-uiapi-record-utils-mobile": "^1.309.0-dev17"
|
|
35
35
|
},
|
|
36
36
|
"volta": {
|
|
37
37
|
"extends": "../../package.json"
|