@salesforce/lwc-adapters-uiapi 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/main.js +56 -12
- package/package.json +4 -4
package/dist/main.js
CHANGED
|
@@ -572,7 +572,7 @@ function createResourceParamsImpl(config, configMetadata) {
|
|
|
572
572
|
}
|
|
573
573
|
return resourceParams;
|
|
574
574
|
}
|
|
575
|
-
// engine version: 0.156.4-
|
|
575
|
+
// engine version: 0.156.4-dev2-78889b7e
|
|
576
576
|
|
|
577
577
|
/**
|
|
578
578
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -11993,7 +11993,7 @@ const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS = {
|
|
|
11993
11993
|
version: RECORD_REPRESENTATION_ERROR_VERSION,
|
|
11994
11994
|
};
|
|
11995
11995
|
function isGraphNode(node) {
|
|
11996
|
-
return node
|
|
11996
|
+
return !!node && node.type === 'Node';
|
|
11997
11997
|
}
|
|
11998
11998
|
function addScalarFieldId(current) {
|
|
11999
11999
|
addScalarField(current, 'Id');
|
|
@@ -12060,6 +12060,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
12060
12060
|
const spanning = spanningLink.follow();
|
|
12061
12061
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
12062
12062
|
if (isExternalLookupFieldKey(spanning)) {
|
|
12063
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
12064
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
12063
12065
|
continue;
|
|
12064
12066
|
}
|
|
12065
12067
|
extractTrackedFieldsToTrie(spanningLink.data.__ref, spanning, next, config, spanningVisitedRecordIds, depth + 1);
|
|
@@ -12092,6 +12094,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
12092
12094
|
const { fields } = state;
|
|
12093
12095
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
12094
12096
|
if (includes.call(fields, 'ExternalId')) {
|
|
12097
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
12098
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
12095
12099
|
continue;
|
|
12096
12100
|
}
|
|
12097
12101
|
for (let s = 0, len = fields.length; s < len; s += 1) {
|
|
@@ -12542,15 +12546,49 @@ function ingestRecordResponse(luvio, response, recordId, recordIngest, conflictM
|
|
|
12542
12546
|
|
|
12543
12547
|
// This function sets fields that we are refreshing to pending
|
|
12544
12548
|
// These values will go into the store
|
|
12545
|
-
function mergePendingFields(newRecord, oldRecord) {
|
|
12546
|
-
// TODO [W-6900046]: avoid casting to any by updating
|
|
12547
|
-
// RecordRepresentationNormalized['fields'] to include `pending:true` property
|
|
12549
|
+
function mergePendingFields(newRecord, oldRecord, existingNode) {
|
|
12548
12550
|
const mergedFields = { ...newRecord.fields };
|
|
12549
12551
|
const merged = { ...newRecord, fields: mergedFields };
|
|
12550
12552
|
const existingFields = keys(oldRecord.fields);
|
|
12551
12553
|
for (let i = 0, len = existingFields.length; i < len; i += 1) {
|
|
12552
12554
|
const spanningFieldName = existingFields[i];
|
|
12553
12555
|
if (newRecord.fields[spanningFieldName] === undefined) {
|
|
12556
|
+
/*
|
|
12557
|
+
* Per W-8058425 external lookups fields are excluded from the tracked fields. However, as covered in
|
|
12558
|
+
* W-11899329, situations can arise in which a merge conflict occurs when the existing record has a
|
|
12559
|
+
* reference to an external lookup field. The exclusion ultimately results in a snapshot stuck in the
|
|
12560
|
+
* pending state. This is an approach to prevent that situation.
|
|
12561
|
+
*
|
|
12562
|
+
* The same logic checks for W-8058425 to "continue" as it relates to not tracking external lookups is
|
|
12563
|
+
* mimicked here as it relates to not marking them as pending.
|
|
12564
|
+
*/
|
|
12565
|
+
// make sure external lookups are NOT marked as pending when `existingNode` is provided
|
|
12566
|
+
if (isGraphNode(existingNode)) {
|
|
12567
|
+
// get the node for the spanning field
|
|
12568
|
+
const fieldValueRep = existingNode
|
|
12569
|
+
.object('fields')
|
|
12570
|
+
.link(spanningFieldName);
|
|
12571
|
+
const field = fieldValueRep.follow();
|
|
12572
|
+
if (isGraphNode(field)) {
|
|
12573
|
+
if (field.isScalar('value') === false) {
|
|
12574
|
+
const record = field
|
|
12575
|
+
.link('value')
|
|
12576
|
+
.follow();
|
|
12577
|
+
if (isExternalLookupFieldKey(record)) {
|
|
12578
|
+
continue;
|
|
12579
|
+
}
|
|
12580
|
+
}
|
|
12581
|
+
}
|
|
12582
|
+
else {
|
|
12583
|
+
const state = fieldValueRep.linkData();
|
|
12584
|
+
if (state !== undefined) {
|
|
12585
|
+
const { fields } = state;
|
|
12586
|
+
if (includes.call(fields, 'ExternalId')) {
|
|
12587
|
+
continue;
|
|
12588
|
+
}
|
|
12589
|
+
}
|
|
12590
|
+
}
|
|
12591
|
+
}
|
|
12554
12592
|
// TODO [W-6900046]: fix above casting issue so we're not stuffing arbitrary things
|
|
12555
12593
|
// into RecordRepresentationNormalized['fields']
|
|
12556
12594
|
mergedFields[spanningFieldName] = {
|
|
@@ -12564,7 +12602,7 @@ function mergePendingFields(newRecord, oldRecord) {
|
|
|
12564
12602
|
// This method gets called
|
|
12565
12603
|
// when incoming record has a higher version
|
|
12566
12604
|
// than the record that is currently in the store
|
|
12567
|
-
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
12605
|
+
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
12568
12606
|
// If the higher version (incoming) does not contain a superset of fields as existing
|
|
12569
12607
|
// then we need to refresh to get updated versions of fields in existing
|
|
12570
12608
|
if (isSuperRecordFieldTrie(incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot) ===
|
|
@@ -12581,14 +12619,14 @@ function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedF
|
|
|
12581
12619
|
};
|
|
12582
12620
|
// We want to mark fields in the store as pending
|
|
12583
12621
|
// Because we don't want to emit any data to components
|
|
12584
|
-
return mergePendingFields(incoming, existing);
|
|
12622
|
+
return mergePendingFields(incoming, existing, existingNode);
|
|
12585
12623
|
}
|
|
12586
12624
|
return incoming;
|
|
12587
12625
|
}
|
|
12588
12626
|
// This method gets called
|
|
12589
12627
|
// when incoming record has a lower version
|
|
12590
12628
|
// than the record that is currently in the store
|
|
12591
|
-
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
12629
|
+
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
12592
12630
|
// If the higher version (existing) does not have a superset of fields as incoming
|
|
12593
12631
|
// then we need to refresh to get updated versions of fields on incoming
|
|
12594
12632
|
if (isSuperRecordFieldTrie(existingTrackedFieldsTrieRoot, incomingTrackedFieldsTrieRoot) ===
|
|
@@ -12598,7 +12636,7 @@ function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTr
|
|
|
12598
12636
|
if (isSupportedEntity(incoming.apiName) === false) {
|
|
12599
12637
|
return mergeRecordFields(existing, incoming);
|
|
12600
12638
|
}
|
|
12601
|
-
const merged = mergePendingFields(existing, incoming);
|
|
12639
|
+
const merged = mergePendingFields(existing, incoming, existingNode);
|
|
12602
12640
|
// update the conflict map to resolve the record conflict in resolveConflict
|
|
12603
12641
|
if (recordConflictMap) {
|
|
12604
12642
|
recordConflictMap.conflicts[incoming.id] = {
|
|
@@ -12637,7 +12675,7 @@ function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
|
|
|
12637
12675
|
extractTrackedFieldsToTrie(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
12638
12676
|
extractTrackedFieldsToTrie(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
12639
12677
|
if (incoming.weakEtag > existing.weakEtag) {
|
|
12640
|
-
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
12678
|
+
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode);
|
|
12641
12679
|
}
|
|
12642
12680
|
return mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
12643
12681
|
}
|
|
@@ -27532,11 +27570,11 @@ function validateAdapterConfig$S(untrustedConfig, _configPropertyNames) {
|
|
|
27532
27570
|
if (config === null) {
|
|
27533
27571
|
return null;
|
|
27534
27572
|
}
|
|
27535
|
-
// recordTypeId coercion is nuts: if `null` (but not undefined) then use MASTER record type id
|
|
27536
27573
|
let recordTypeId = config.recordTypeId;
|
|
27537
27574
|
if (recordTypeId === undefined) {
|
|
27538
27575
|
// must check untrusted bc config has been coerced
|
|
27539
|
-
if (untrustedConfig.recordTypeId !== null
|
|
27576
|
+
if (untrustedConfig.recordTypeId !== null &&
|
|
27577
|
+
untrustedConfig.recordTypeId !== undefined) {
|
|
27540
27578
|
return null;
|
|
27541
27579
|
}
|
|
27542
27580
|
recordTypeId = MAIN_RECORD_TYPE_ID;
|
|
@@ -61927,6 +61965,12 @@ function selectTypeLinkWithPagination(resolvedLink, sel, fieldData, reader, key,
|
|
|
61927
61965
|
return;
|
|
61928
61966
|
}
|
|
61929
61967
|
}
|
|
61968
|
+
else if (totalEdges === 0 && !listIsComplete) {
|
|
61969
|
+
// empty edge list, but the list isn't complete?
|
|
61970
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
61971
|
+
throw new Error("page size of zero, but pageInfo .hasNextPage is true.");
|
|
61972
|
+
}
|
|
61973
|
+
}
|
|
61930
61974
|
else {
|
|
61931
61975
|
if (startOffset === undefined || endOffset === undefined) {
|
|
61932
61976
|
reader.markMissingLink(fieldData.__ref);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lwc-adapters-uiapi",
|
|
3
|
-
"version": "1.309.0-
|
|
3
|
+
"version": "1.309.0-dev17",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "UIAPI adapters with LWC bindings",
|
|
6
6
|
"module": "dist/main.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"clean": "rm -rf dist src/generated"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@salesforce/lds-adapters-uiapi": "^1.309.0-
|
|
34
|
+
"@salesforce/lds-adapters-uiapi": "^1.309.0-dev17"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@luvio/lwc-luvio": "0.156.4-
|
|
38
|
-
"@salesforce/lds-default-luvio": "^1.309.0-
|
|
37
|
+
"@luvio/lwc-luvio": "0.156.4-dev2",
|
|
38
|
+
"@salesforce/lds-default-luvio": "^1.309.0-dev17"
|
|
39
39
|
}
|
|
40
40
|
}
|