@salesforce/lds-ads-bridge 1.320.0 → 1.321.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/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.
|
|
436
|
+
// engine version: 0.156.5-f5fd8c7a
|
|
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.
|
|
484
|
+
// version: 1.321.0-1fd3fba1c4
|
|
485
485
|
|
|
486
486
|
/**
|
|
487
487
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -7736,7 +7736,7 @@ const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS = {
|
|
|
7736
7736
|
version: RECORD_REPRESENTATION_ERROR_VERSION,
|
|
7737
7737
|
};
|
|
7738
7738
|
function isGraphNode$1(node) {
|
|
7739
|
-
return node
|
|
7739
|
+
return !!node && node.type === 'Node';
|
|
7740
7740
|
}
|
|
7741
7741
|
function addScalarFieldId(current) {
|
|
7742
7742
|
addScalarField(current, 'Id');
|
|
@@ -7803,6 +7803,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
7803
7803
|
const spanning = spanningLink.follow();
|
|
7804
7804
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
7805
7805
|
if (isExternalLookupFieldKey(spanning)) {
|
|
7806
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
7807
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
7806
7808
|
continue;
|
|
7807
7809
|
}
|
|
7808
7810
|
extractTrackedFieldsToTrie(spanningLink.data.__ref, spanning, next, config, spanningVisitedRecordIds, depth + 1);
|
|
@@ -7835,6 +7837,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
7835
7837
|
const { fields } = state;
|
|
7836
7838
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
7837
7839
|
if (includes.call(fields, 'ExternalId')) {
|
|
7840
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
7841
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
7838
7842
|
continue;
|
|
7839
7843
|
}
|
|
7840
7844
|
for (let s = 0, len = fields.length; s < len; s += 1) {
|
|
@@ -8046,15 +8050,49 @@ function isSuperRecordFieldTrie(a, b) {
|
|
|
8046
8050
|
|
|
8047
8051
|
// This function sets fields that we are refreshing to pending
|
|
8048
8052
|
// These values will go into the store
|
|
8049
|
-
function mergePendingFields(newRecord, oldRecord) {
|
|
8050
|
-
// TODO [W-6900046]: avoid casting to any by updating
|
|
8051
|
-
// RecordRepresentationNormalized['fields'] to include `pending:true` property
|
|
8053
|
+
function mergePendingFields(newRecord, oldRecord, existingNode) {
|
|
8052
8054
|
const mergedFields = { ...newRecord.fields };
|
|
8053
8055
|
const merged = { ...newRecord, fields: mergedFields };
|
|
8054
8056
|
const existingFields = keys$1(oldRecord.fields);
|
|
8055
8057
|
for (let i = 0, len = existingFields.length; i < len; i += 1) {
|
|
8056
8058
|
const spanningFieldName = existingFields[i];
|
|
8057
8059
|
if (newRecord.fields[spanningFieldName] === undefined) {
|
|
8060
|
+
/*
|
|
8061
|
+
* Per W-8058425 external lookups fields are excluded from the tracked fields. However, as covered in
|
|
8062
|
+
* W-11899329, situations can arise in which a merge conflict occurs when the existing record has a
|
|
8063
|
+
* reference to an external lookup field. The exclusion ultimately results in a snapshot stuck in the
|
|
8064
|
+
* pending state. This is an approach to prevent that situation.
|
|
8065
|
+
*
|
|
8066
|
+
* The same logic checks for W-8058425 to "continue" as it relates to not tracking external lookups is
|
|
8067
|
+
* mimicked here as it relates to not marking them as pending.
|
|
8068
|
+
*/
|
|
8069
|
+
// make sure external lookups are NOT marked as pending when `existingNode` is provided
|
|
8070
|
+
if (isGraphNode$1(existingNode)) {
|
|
8071
|
+
// get the node for the spanning field
|
|
8072
|
+
const fieldValueRep = existingNode
|
|
8073
|
+
.object('fields')
|
|
8074
|
+
.link(spanningFieldName);
|
|
8075
|
+
const field = fieldValueRep.follow();
|
|
8076
|
+
if (isGraphNode$1(field)) {
|
|
8077
|
+
if (field.isScalar('value') === false) {
|
|
8078
|
+
const record = field
|
|
8079
|
+
.link('value')
|
|
8080
|
+
.follow();
|
|
8081
|
+
if (isExternalLookupFieldKey(record)) {
|
|
8082
|
+
continue;
|
|
8083
|
+
}
|
|
8084
|
+
}
|
|
8085
|
+
}
|
|
8086
|
+
else {
|
|
8087
|
+
const state = fieldValueRep.linkData();
|
|
8088
|
+
if (state !== undefined) {
|
|
8089
|
+
const { fields } = state;
|
|
8090
|
+
if (includes.call(fields, 'ExternalId')) {
|
|
8091
|
+
continue;
|
|
8092
|
+
}
|
|
8093
|
+
}
|
|
8094
|
+
}
|
|
8095
|
+
}
|
|
8058
8096
|
// TODO [W-6900046]: fix above casting issue so we're not stuffing arbitrary things
|
|
8059
8097
|
// into RecordRepresentationNormalized['fields']
|
|
8060
8098
|
mergedFields[spanningFieldName] = {
|
|
@@ -8068,7 +8106,7 @@ function mergePendingFields(newRecord, oldRecord) {
|
|
|
8068
8106
|
// This method gets called
|
|
8069
8107
|
// when incoming record has a higher version
|
|
8070
8108
|
// than the record that is currently in the store
|
|
8071
|
-
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
8109
|
+
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
8072
8110
|
// If the higher version (incoming) does not contain a superset of fields as existing
|
|
8073
8111
|
// then we need to refresh to get updated versions of fields in existing
|
|
8074
8112
|
if (isSuperRecordFieldTrie(incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot) ===
|
|
@@ -8085,14 +8123,14 @@ function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedF
|
|
|
8085
8123
|
};
|
|
8086
8124
|
// We want to mark fields in the store as pending
|
|
8087
8125
|
// Because we don't want to emit any data to components
|
|
8088
|
-
return mergePendingFields(incoming, existing);
|
|
8126
|
+
return mergePendingFields(incoming, existing, existingNode);
|
|
8089
8127
|
}
|
|
8090
8128
|
return incoming;
|
|
8091
8129
|
}
|
|
8092
8130
|
// This method gets called
|
|
8093
8131
|
// when incoming record has a lower version
|
|
8094
8132
|
// than the record that is currently in the store
|
|
8095
|
-
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
8133
|
+
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
8096
8134
|
// If the higher version (existing) does not have a superset of fields as incoming
|
|
8097
8135
|
// then we need to refresh to get updated versions of fields on incoming
|
|
8098
8136
|
if (isSuperRecordFieldTrie(existingTrackedFieldsTrieRoot, incomingTrackedFieldsTrieRoot) ===
|
|
@@ -8102,7 +8140,7 @@ function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTr
|
|
|
8102
8140
|
if (isSupportedEntity(incoming.apiName) === false) {
|
|
8103
8141
|
return mergeRecordFields(existing, incoming);
|
|
8104
8142
|
}
|
|
8105
|
-
const merged = mergePendingFields(existing, incoming);
|
|
8143
|
+
const merged = mergePendingFields(existing, incoming, existingNode);
|
|
8106
8144
|
// update the conflict map to resolve the record conflict in resolveConflict
|
|
8107
8145
|
if (recordConflictMap) {
|
|
8108
8146
|
recordConflictMap.conflicts[incoming.id] = {
|
|
@@ -8141,7 +8179,7 @@ function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
|
|
|
8141
8179
|
extractTrackedFieldsToTrie(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
8142
8180
|
extractTrackedFieldsToTrie(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
8143
8181
|
if (incoming.weakEtag > existing.weakEtag) {
|
|
8144
|
-
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
8182
|
+
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode);
|
|
8145
8183
|
}
|
|
8146
8184
|
return mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
8147
8185
|
}
|
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.
|
|
3
|
+
"version": "1.321.0",
|
|
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.
|
|
34
|
-
"@salesforce/lds-uiapi-record-utils-mobile": "^1.
|
|
33
|
+
"@salesforce/lds-adapters-uiapi": "^1.321.0",
|
|
34
|
+
"@salesforce/lds-uiapi-record-utils-mobile": "^1.321.0"
|
|
35
35
|
},
|
|
36
36
|
"volta": {
|
|
37
37
|
"extends": "../../package.json"
|