@salesforce/lwc-adapters-uiapi 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/main.js +54 -10
- 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.
|
|
575
|
+
// engine version: 0.156.5-f5fd8c7a
|
|
576
576
|
|
|
577
577
|
/**
|
|
578
578
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -12156,7 +12156,7 @@ const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS = {
|
|
|
12156
12156
|
version: RECORD_REPRESENTATION_ERROR_VERSION,
|
|
12157
12157
|
};
|
|
12158
12158
|
function isGraphNode(node) {
|
|
12159
|
-
return node
|
|
12159
|
+
return !!node && node.type === 'Node';
|
|
12160
12160
|
}
|
|
12161
12161
|
function addScalarFieldId(current) {
|
|
12162
12162
|
addScalarField(current, 'Id');
|
|
@@ -12223,6 +12223,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
12223
12223
|
const spanning = spanningLink.follow();
|
|
12224
12224
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
12225
12225
|
if (isExternalLookupFieldKey(spanning)) {
|
|
12226
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
12227
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
12226
12228
|
continue;
|
|
12227
12229
|
}
|
|
12228
12230
|
extractTrackedFieldsToTrie(spanningLink.data.__ref, spanning, next, config, spanningVisitedRecordIds, depth + 1);
|
|
@@ -12255,6 +12257,8 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
12255
12257
|
const { fields } = state;
|
|
12256
12258
|
// W-8058425, do not include external lookups added by getTrackedFields
|
|
12257
12259
|
if (includes.call(fields, 'ExternalId')) {
|
|
12260
|
+
// NOTE: the logic to get here is mimicked in RecordRepresentation/merge::mergePendingFields as of
|
|
12261
|
+
// W-11899329 due to issues with external lookups being marked pending but never fetched
|
|
12258
12262
|
continue;
|
|
12259
12263
|
}
|
|
12260
12264
|
for (let s = 0, len = fields.length; s < len; s += 1) {
|
|
@@ -12705,15 +12709,49 @@ function ingestRecordResponse(luvio, response, recordId, recordIngest, conflictM
|
|
|
12705
12709
|
|
|
12706
12710
|
// This function sets fields that we are refreshing to pending
|
|
12707
12711
|
// These values will go into the store
|
|
12708
|
-
function mergePendingFields(newRecord, oldRecord) {
|
|
12709
|
-
// TODO [W-6900046]: avoid casting to any by updating
|
|
12710
|
-
// RecordRepresentationNormalized['fields'] to include `pending:true` property
|
|
12712
|
+
function mergePendingFields(newRecord, oldRecord, existingNode) {
|
|
12711
12713
|
const mergedFields = { ...newRecord.fields };
|
|
12712
12714
|
const merged = { ...newRecord, fields: mergedFields };
|
|
12713
12715
|
const existingFields = keys(oldRecord.fields);
|
|
12714
12716
|
for (let i = 0, len = existingFields.length; i < len; i += 1) {
|
|
12715
12717
|
const spanningFieldName = existingFields[i];
|
|
12716
12718
|
if (newRecord.fields[spanningFieldName] === undefined) {
|
|
12719
|
+
/*
|
|
12720
|
+
* Per W-8058425 external lookups fields are excluded from the tracked fields. However, as covered in
|
|
12721
|
+
* W-11899329, situations can arise in which a merge conflict occurs when the existing record has a
|
|
12722
|
+
* reference to an external lookup field. The exclusion ultimately results in a snapshot stuck in the
|
|
12723
|
+
* pending state. This is an approach to prevent that situation.
|
|
12724
|
+
*
|
|
12725
|
+
* The same logic checks for W-8058425 to "continue" as it relates to not tracking external lookups is
|
|
12726
|
+
* mimicked here as it relates to not marking them as pending.
|
|
12727
|
+
*/
|
|
12728
|
+
// make sure external lookups are NOT marked as pending when `existingNode` is provided
|
|
12729
|
+
if (isGraphNode(existingNode)) {
|
|
12730
|
+
// get the node for the spanning field
|
|
12731
|
+
const fieldValueRep = existingNode
|
|
12732
|
+
.object('fields')
|
|
12733
|
+
.link(spanningFieldName);
|
|
12734
|
+
const field = fieldValueRep.follow();
|
|
12735
|
+
if (isGraphNode(field)) {
|
|
12736
|
+
if (field.isScalar('value') === false) {
|
|
12737
|
+
const record = field
|
|
12738
|
+
.link('value')
|
|
12739
|
+
.follow();
|
|
12740
|
+
if (isExternalLookupFieldKey(record)) {
|
|
12741
|
+
continue;
|
|
12742
|
+
}
|
|
12743
|
+
}
|
|
12744
|
+
}
|
|
12745
|
+
else {
|
|
12746
|
+
const state = fieldValueRep.linkData();
|
|
12747
|
+
if (state !== undefined) {
|
|
12748
|
+
const { fields } = state;
|
|
12749
|
+
if (includes.call(fields, 'ExternalId')) {
|
|
12750
|
+
continue;
|
|
12751
|
+
}
|
|
12752
|
+
}
|
|
12753
|
+
}
|
|
12754
|
+
}
|
|
12717
12755
|
// TODO [W-6900046]: fix above casting issue so we're not stuffing arbitrary things
|
|
12718
12756
|
// into RecordRepresentationNormalized['fields']
|
|
12719
12757
|
mergedFields[spanningFieldName] = {
|
|
@@ -12727,7 +12765,7 @@ function mergePendingFields(newRecord, oldRecord) {
|
|
|
12727
12765
|
// This method gets called
|
|
12728
12766
|
// when incoming record has a higher version
|
|
12729
12767
|
// than the record that is currently in the store
|
|
12730
|
-
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
12768
|
+
function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
12731
12769
|
// If the higher version (incoming) does not contain a superset of fields as existing
|
|
12732
12770
|
// then we need to refresh to get updated versions of fields in existing
|
|
12733
12771
|
if (isSuperRecordFieldTrie(incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot) ===
|
|
@@ -12744,14 +12782,14 @@ function mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedF
|
|
|
12744
12782
|
};
|
|
12745
12783
|
// We want to mark fields in the store as pending
|
|
12746
12784
|
// Because we don't want to emit any data to components
|
|
12747
|
-
return mergePendingFields(incoming, existing);
|
|
12785
|
+
return mergePendingFields(incoming, existing, existingNode);
|
|
12748
12786
|
}
|
|
12749
12787
|
return incoming;
|
|
12750
12788
|
}
|
|
12751
12789
|
// This method gets called
|
|
12752
12790
|
// when incoming record has a lower version
|
|
12753
12791
|
// than the record that is currently in the store
|
|
12754
|
-
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap) {
|
|
12792
|
+
function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode) {
|
|
12755
12793
|
// If the higher version (existing) does not have a superset of fields as incoming
|
|
12756
12794
|
// then we need to refresh to get updated versions of fields on incoming
|
|
12757
12795
|
if (isSuperRecordFieldTrie(existingTrackedFieldsTrieRoot, incomingTrackedFieldsTrieRoot) ===
|
|
@@ -12761,7 +12799,7 @@ function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTr
|
|
|
12761
12799
|
if (isSupportedEntity(incoming.apiName) === false) {
|
|
12762
12800
|
return mergeRecordFields(existing, incoming);
|
|
12763
12801
|
}
|
|
12764
|
-
const merged = mergePendingFields(existing, incoming);
|
|
12802
|
+
const merged = mergePendingFields(existing, incoming, existingNode);
|
|
12765
12803
|
// update the conflict map to resolve the record conflict in resolveConflict
|
|
12766
12804
|
if (recordConflictMap) {
|
|
12767
12805
|
recordConflictMap.conflicts[incoming.id] = {
|
|
@@ -12800,7 +12838,7 @@ function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
|
|
|
12800
12838
|
extractTrackedFieldsToTrie(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
12801
12839
|
extractTrackedFieldsToTrie(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
12802
12840
|
if (incoming.weakEtag > existing.weakEtag) {
|
|
12803
|
-
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
12841
|
+
return mergeAndRefreshHigherVersionRecord(incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap, existingNode);
|
|
12804
12842
|
}
|
|
12805
12843
|
return mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTrackedFieldsTrieRoot, existingTrackedFieldsTrieRoot, recordConflictMap);
|
|
12806
12844
|
}
|
|
@@ -60545,6 +60583,12 @@ function selectTypeLinkWithPagination(resolvedLink, sel, fieldData, reader, key,
|
|
|
60545
60583
|
return;
|
|
60546
60584
|
}
|
|
60547
60585
|
}
|
|
60586
|
+
else if (totalEdges === 0 && !listIsComplete) {
|
|
60587
|
+
// empty edge list, but the list isn't complete?
|
|
60588
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
60589
|
+
throw new Error("page size of zero, but pageInfo .hasNextPage is true.");
|
|
60590
|
+
}
|
|
60591
|
+
}
|
|
60548
60592
|
else {
|
|
60549
60593
|
if (startOffset === undefined || endOffset === undefined) {
|
|
60550
60594
|
reader.markMissingLink(fieldData.__ref);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lwc-adapters-uiapi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.321.0",
|
|
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.
|
|
34
|
+
"@salesforce/lds-adapters-uiapi": "^1.321.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@luvio/lwc-luvio": "0.156.
|
|
38
|
-
"@salesforce/lds-default-luvio": "^1.
|
|
37
|
+
"@luvio/lwc-luvio": "0.156.5",
|
|
38
|
+
"@salesforce/lds-default-luvio": "^1.321.0"
|
|
39
39
|
}
|
|
40
40
|
}
|