@salesforce/lds-worker-api 1.360.0 → 1.360.1

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.
@@ -1128,4 +1128,4 @@ if (process.env.NODE_ENV !== 'production') {
1128
1128
  }
1129
1129
 
1130
1130
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1131
- // version: 1.360.0-580249acee
1131
+ // version: 1.360.1-509ca55373
@@ -4271,7 +4271,7 @@ function withDefaultLuvio(callback) {
4271
4271
  }
4272
4272
  callbacks.push(callback);
4273
4273
  }
4274
- // version: 1.360.0-580249acee
4274
+ // version: 1.360.1-509ca55373
4275
4275
 
4276
4276
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4277
4277
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5219,7 +5219,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
5219
5219
  const { apiFamily, name } = metadata;
5220
5220
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5221
5221
  }
5222
- // version: 1.360.0-580249acee
5222
+ // version: 1.360.1-509ca55373
5223
5223
 
5224
5224
  /**
5225
5225
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -33995,7 +33995,7 @@ withDefaultLuvio((luvio) => {
33995
33995
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
33996
33996
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
33997
33997
  });
33998
- // version: 1.360.0-3cf173d4f8
33998
+ // version: 1.360.1-0f1676c606
33999
33999
 
34000
34000
  /**
34001
34001
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -81916,7 +81916,75 @@ function filterToPredicates(where, recordType, alias, objectInfoMap, joins, draf
81916
81916
  // in 'Account' has the 'Owner' as the 'RelationshipName', the api name in 'referenceToInfos' is 'User'
81917
81917
  if (fieldInfo.referenceToInfos.length === 1) {
81918
81918
  const childRecordType = fieldInfo.referenceToInfos[0].apiName;
81919
- predicates.push(...filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins));
81919
+ let p = filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins);
81920
+ if (isSinglePredicate(p[0]) && p[0].value === null) {
81921
+ // @W-18311580 - this is a reference field with a null value. We need to ensure that we handle the case
81922
+ // where we are joining to a record that may not exist in our offline database, so we need to detect if
81923
+ // the value is really a null, or if it is a missing record in the offline database.
81924
+ //
81925
+ // This effecitvely adds the following predicates to a "where Contact.Account.Name IS NULL" query:
81926
+ //
81927
+ // AND (
81928
+ // (
81929
+ // json_extract("Contact__c_Account__r".data, '$.fields.Id.value') IS NOT NULL (a)
81930
+ // AND json_extract("Contact__c".data, '$.fields.AccountId.value') IS NOT NULL (b)
81931
+ // )
81932
+ // OR json_extract("Contact__c".data, '$.fields.AccountId.value') IS NULL (c)
81933
+ // )
81934
+ //
81935
+ // Where:
81936
+ // (a) AND (b) ensures we have an account record when it is supposed to exist,
81937
+ // OR (c) if AccountId is null, we know we are not referencing an account record.
81938
+ let notNullPredicate = {
81939
+ type: PredicateType.compound,
81940
+ operator: 'and',
81941
+ children: [
81942
+ {
81943
+ alias: alias,
81944
+ leftPath: leftPath,
81945
+ operator: 'IS NOT',
81946
+ value: null,
81947
+ dataType: 'String',
81948
+ type: PredicateType.single,
81949
+ isCaseSensitive: true,
81950
+ },
81951
+ {
81952
+ alias: childAlias,
81953
+ leftPath: `$.fields.Id.value`,
81954
+ operator: 'IS NOT',
81955
+ value: null,
81956
+ dataType: 'String',
81957
+ type: PredicateType.single,
81958
+ isCaseSensitive: true,
81959
+ },
81960
+ ],
81961
+ };
81962
+ let nullPredicate = {
81963
+ type: PredicateType.compound,
81964
+ operator: 'or',
81965
+ children: [
81966
+ notNullPredicate,
81967
+ {
81968
+ alias: alias,
81969
+ leftPath: leftPath,
81970
+ operator: 'IS',
81971
+ value: null,
81972
+ dataType: 'String',
81973
+ type: PredicateType.single,
81974
+ isCaseSensitive: true,
81975
+ },
81976
+ ],
81977
+ };
81978
+ let compoundPredicate = {
81979
+ type: PredicateType.compound,
81980
+ operator: 'and',
81981
+ children: [...p, nullPredicate],
81982
+ };
81983
+ predicates.push(compoundPredicate);
81984
+ }
81985
+ else {
81986
+ predicates.push(...p);
81987
+ }
81920
81988
  }
81921
81989
  else {
81922
81990
  // @W-12618378 polymorphic query sometimes does not work as expected on server. The GQL on certain entities could fail.
@@ -91077,7 +91145,6 @@ class RecordLoaderSOQLComposite extends NetworkRecordLoader {
91077
91145
  }
91078
91146
  }
91079
91147
  const query = `SELECT ${fields.join(',')} FROM ${batch.type} `;
91080
- // console.log(`DUSTIN: soql batch query: ${query}`);
91081
91148
  return query;
91082
91149
  }
91083
91150
  generateWhere(ids) {
@@ -93102,7 +93169,7 @@ register$1({
93102
93169
  id: '@salesforce/lds-network-adapter',
93103
93170
  instrument: instrument$2,
93104
93171
  });
93105
- // version: 1.360.0-580249acee
93172
+ // version: 1.360.1-509ca55373
93106
93173
 
93107
93174
  const { create: create$2, keys: keys$2 } = Object;
93108
93175
  const { stringify, parse } = JSON;
@@ -118769,7 +118836,7 @@ register$1({
118769
118836
  configuration: { ...configurationForGraphQLAdapters$1 },
118770
118837
  instrument: instrument$1,
118771
118838
  });
118772
- // version: 1.360.0-3cf173d4f8
118839
+ // version: 1.360.1-0f1676c606
118773
118840
 
118774
118841
  // On core the unstable adapters are re-exported with different names,
118775
118842
  // we want to match them here.
@@ -118921,7 +118988,7 @@ withDefaultLuvio((luvio) => {
118921
118988
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
118922
118989
  graphQLImperative = ldsAdapter;
118923
118990
  });
118924
- // version: 1.360.0-3cf173d4f8
118991
+ // version: 1.360.1-0f1676c606
118925
118992
 
118926
118993
  var gqlApi = /*#__PURE__*/Object.freeze({
118927
118994
  __proto__: null,
@@ -119713,7 +119780,7 @@ const callbacks$1 = [];
119713
119780
  function register(r) {
119714
119781
  callbacks$1.forEach((callback) => callback(r));
119715
119782
  }
119716
- // version: 1.360.0-580249acee
119783
+ // version: 1.360.1-509ca55373
119717
119784
 
119718
119785
  /**
119719
119786
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -120793,4 +120860,4 @@ const { luvio } = getRuntime();
120793
120860
  setDefaultLuvio({ luvio });
120794
120861
 
120795
120862
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
120796
- // version: 1.360.0-580249acee
120863
+ // version: 1.360.1-509ca55373
@@ -4277,7 +4277,7 @@
4277
4277
  }
4278
4278
  callbacks.push(callback);
4279
4279
  }
4280
- // version: 1.360.0-580249acee
4280
+ // version: 1.360.1-509ca55373
4281
4281
 
4282
4282
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4283
4283
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5225,7 +5225,7 @@
5225
5225
  const { apiFamily, name } = metadata;
5226
5226
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5227
5227
  }
5228
- // version: 1.360.0-580249acee
5228
+ // version: 1.360.1-509ca55373
5229
5229
 
5230
5230
  /**
5231
5231
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -34001,7 +34001,7 @@
34001
34001
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
34002
34002
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
34003
34003
  });
34004
- // version: 1.360.0-3cf173d4f8
34004
+ // version: 1.360.1-0f1676c606
34005
34005
 
34006
34006
  /**
34007
34007
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -81922,7 +81922,75 @@
81922
81922
  // in 'Account' has the 'Owner' as the 'RelationshipName', the api name in 'referenceToInfos' is 'User'
81923
81923
  if (fieldInfo.referenceToInfos.length === 1) {
81924
81924
  const childRecordType = fieldInfo.referenceToInfos[0].apiName;
81925
- predicates.push(...filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins));
81925
+ let p = filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins);
81926
+ if (isSinglePredicate(p[0]) && p[0].value === null) {
81927
+ // @W-18311580 - this is a reference field with a null value. We need to ensure that we handle the case
81928
+ // where we are joining to a record that may not exist in our offline database, so we need to detect if
81929
+ // the value is really a null, or if it is a missing record in the offline database.
81930
+ //
81931
+ // This effecitvely adds the following predicates to a "where Contact.Account.Name IS NULL" query:
81932
+ //
81933
+ // AND (
81934
+ // (
81935
+ // json_extract("Contact__c_Account__r".data, '$.fields.Id.value') IS NOT NULL (a)
81936
+ // AND json_extract("Contact__c".data, '$.fields.AccountId.value') IS NOT NULL (b)
81937
+ // )
81938
+ // OR json_extract("Contact__c".data, '$.fields.AccountId.value') IS NULL (c)
81939
+ // )
81940
+ //
81941
+ // Where:
81942
+ // (a) AND (b) ensures we have an account record when it is supposed to exist,
81943
+ // OR (c) if AccountId is null, we know we are not referencing an account record.
81944
+ let notNullPredicate = {
81945
+ type: PredicateType.compound,
81946
+ operator: 'and',
81947
+ children: [
81948
+ {
81949
+ alias: alias,
81950
+ leftPath: leftPath,
81951
+ operator: 'IS NOT',
81952
+ value: null,
81953
+ dataType: 'String',
81954
+ type: PredicateType.single,
81955
+ isCaseSensitive: true,
81956
+ },
81957
+ {
81958
+ alias: childAlias,
81959
+ leftPath: `$.fields.Id.value`,
81960
+ operator: 'IS NOT',
81961
+ value: null,
81962
+ dataType: 'String',
81963
+ type: PredicateType.single,
81964
+ isCaseSensitive: true,
81965
+ },
81966
+ ],
81967
+ };
81968
+ let nullPredicate = {
81969
+ type: PredicateType.compound,
81970
+ operator: 'or',
81971
+ children: [
81972
+ notNullPredicate,
81973
+ {
81974
+ alias: alias,
81975
+ leftPath: leftPath,
81976
+ operator: 'IS',
81977
+ value: null,
81978
+ dataType: 'String',
81979
+ type: PredicateType.single,
81980
+ isCaseSensitive: true,
81981
+ },
81982
+ ],
81983
+ };
81984
+ let compoundPredicate = {
81985
+ type: PredicateType.compound,
81986
+ operator: 'and',
81987
+ children: [...p, nullPredicate],
81988
+ };
81989
+ predicates.push(compoundPredicate);
81990
+ }
81991
+ else {
81992
+ predicates.push(...p);
81993
+ }
81926
81994
  }
81927
81995
  else {
81928
81996
  // @W-12618378 polymorphic query sometimes does not work as expected on server. The GQL on certain entities could fail.
@@ -91083,7 +91151,6 @@
91083
91151
  }
91084
91152
  }
91085
91153
  const query = `SELECT ${fields.join(',')} FROM ${batch.type} `;
91086
- // console.log(`DUSTIN: soql batch query: ${query}`);
91087
91154
  return query;
91088
91155
  }
91089
91156
  generateWhere(ids) {
@@ -93108,7 +93175,7 @@
93108
93175
  id: '@salesforce/lds-network-adapter',
93109
93176
  instrument: instrument$2,
93110
93177
  });
93111
- // version: 1.360.0-580249acee
93178
+ // version: 1.360.1-509ca55373
93112
93179
 
93113
93180
  const { create: create$2, keys: keys$2 } = Object;
93114
93181
  const { stringify, parse } = JSON;
@@ -118775,7 +118842,7 @@
118775
118842
  configuration: { ...configurationForGraphQLAdapters$1 },
118776
118843
  instrument: instrument$1,
118777
118844
  });
118778
- // version: 1.360.0-3cf173d4f8
118845
+ // version: 1.360.1-0f1676c606
118779
118846
 
118780
118847
  // On core the unstable adapters are re-exported with different names,
118781
118848
  // we want to match them here.
@@ -118927,7 +118994,7 @@
118927
118994
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
118928
118995
  graphQLImperative = ldsAdapter;
118929
118996
  });
118930
- // version: 1.360.0-3cf173d4f8
118997
+ // version: 1.360.1-0f1676c606
118931
118998
 
118932
118999
  var gqlApi = /*#__PURE__*/Object.freeze({
118933
119000
  __proto__: null,
@@ -119719,7 +119786,7 @@
119719
119786
  function register(r) {
119720
119787
  callbacks$1.forEach((callback) => callback(r));
119721
119788
  }
119722
- // version: 1.360.0-580249acee
119789
+ // version: 1.360.1-509ca55373
119723
119790
 
119724
119791
  /**
119725
119792
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -120818,4 +120885,4 @@
120818
120885
  exports.subscribeToAdapter = subscribeToAdapter;
120819
120886
 
120820
120887
  }));
120821
- // version: 1.360.0-580249acee
120888
+ // version: 1.360.1-509ca55373
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.360.0",
3
+ "version": "1.360.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,14 +35,14 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.360.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.360.0",
40
- "@salesforce/lds-default-luvio": "^1.360.0",
41
- "@salesforce/lds-drafts": "^1.360.0",
42
- "@salesforce/lds-graphql-parser": "^1.360.0",
43
- "@salesforce/lds-luvio-engine": "^1.360.0",
44
- "@salesforce/lds-runtime-mobile": "^1.360.0",
45
- "@salesforce/nimbus-plugin-lds": "^1.360.0",
38
+ "@salesforce/lds-adapters-graphql": "^1.360.1",
39
+ "@salesforce/lds-adapters-uiapi": "^1.360.1",
40
+ "@salesforce/lds-default-luvio": "^1.360.1",
41
+ "@salesforce/lds-drafts": "^1.360.1",
42
+ "@salesforce/lds-graphql-parser": "^1.360.1",
43
+ "@salesforce/lds-luvio-engine": "^1.360.1",
44
+ "@salesforce/lds-runtime-mobile": "^1.360.1",
45
+ "@salesforce/nimbus-plugin-lds": "^1.360.1",
46
46
  "ajv": "^8.11.0",
47
47
  "glob": "^7.1.5",
48
48
  "nimbus-types": "^2.0.0-alpha1",