@salesforce/lds-runtime-mobile 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.
Files changed (3) hide show
  1. package/dist/main.js +70 -3
  2. package/package.json +14 -14
  3. package/sfdc/main.js +70 -3
package/dist/main.js CHANGED
@@ -44377,7 +44377,75 @@ function filterToPredicates(where, recordType, alias, objectInfoMap, joins, draf
44377
44377
  // in 'Account' has the 'Owner' as the 'RelationshipName', the api name in 'referenceToInfos' is 'User'
44378
44378
  if (fieldInfo.referenceToInfos.length === 1) {
44379
44379
  const childRecordType = fieldInfo.referenceToInfos[0].apiName;
44380
- predicates.push(...filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins));
44380
+ let p = filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins);
44381
+ if (isSinglePredicate(p[0]) && p[0].value === null) {
44382
+ // @W-18311580 - this is a reference field with a null value. We need to ensure that we handle the case
44383
+ // where we are joining to a record that may not exist in our offline database, so we need to detect if
44384
+ // the value is really a null, or if it is a missing record in the offline database.
44385
+ //
44386
+ // This effecitvely adds the following predicates to a "where Contact.Account.Name IS NULL" query:
44387
+ //
44388
+ // AND (
44389
+ // (
44390
+ // json_extract("Contact__c_Account__r".data, '$.fields.Id.value') IS NOT NULL (a)
44391
+ // AND json_extract("Contact__c".data, '$.fields.AccountId.value') IS NOT NULL (b)
44392
+ // )
44393
+ // OR json_extract("Contact__c".data, '$.fields.AccountId.value') IS NULL (c)
44394
+ // )
44395
+ //
44396
+ // Where:
44397
+ // (a) AND (b) ensures we have an account record when it is supposed to exist,
44398
+ // OR (c) if AccountId is null, we know we are not referencing an account record.
44399
+ let notNullPredicate = {
44400
+ type: PredicateType.compound,
44401
+ operator: 'and',
44402
+ children: [
44403
+ {
44404
+ alias: alias,
44405
+ leftPath: leftPath,
44406
+ operator: 'IS NOT',
44407
+ value: null,
44408
+ dataType: 'String',
44409
+ type: PredicateType.single,
44410
+ isCaseSensitive: true,
44411
+ },
44412
+ {
44413
+ alias: childAlias,
44414
+ leftPath: `$.fields.Id.value`,
44415
+ operator: 'IS NOT',
44416
+ value: null,
44417
+ dataType: 'String',
44418
+ type: PredicateType.single,
44419
+ isCaseSensitive: true,
44420
+ },
44421
+ ],
44422
+ };
44423
+ let nullPredicate = {
44424
+ type: PredicateType.compound,
44425
+ operator: 'or',
44426
+ children: [
44427
+ notNullPredicate,
44428
+ {
44429
+ alias: alias,
44430
+ leftPath: leftPath,
44431
+ operator: 'IS',
44432
+ value: null,
44433
+ dataType: 'String',
44434
+ type: PredicateType.single,
44435
+ isCaseSensitive: true,
44436
+ },
44437
+ ],
44438
+ };
44439
+ let compoundPredicate = {
44440
+ type: PredicateType.compound,
44441
+ operator: 'and',
44442
+ children: [...p, nullPredicate],
44443
+ };
44444
+ predicates.push(compoundPredicate);
44445
+ }
44446
+ else {
44447
+ predicates.push(...p);
44448
+ }
44381
44449
  }
44382
44450
  else {
44383
44451
  // @W-12618378 polymorphic query sometimes does not work as expected on server. The GQL on certain entities could fail.
@@ -53681,7 +53749,6 @@ class RecordLoaderSOQLComposite extends NetworkRecordLoader {
53681
53749
  }
53682
53750
  }
53683
53751
  const query = `SELECT ${fields.join(',')} FROM ${batch.type} `;
53684
- // console.log(`DUSTIN: soql batch query: ${query}`);
53685
53752
  return query;
53686
53753
  }
53687
53754
  generateWhere(ids) {
@@ -55736,4 +55803,4 @@ register({
55736
55803
  });
55737
55804
 
55738
55805
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, registerReportObserver, reportGraphqlQueryParseError };
55739
- // version: 1.360.0-580249acee
55806
+ // version: 1.360.1-509ca55373
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.360.0",
3
+ "version": "1.360.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
@@ -32,24 +32,24 @@
32
32
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
33
33
  },
34
34
  "dependencies": {
35
- "@salesforce/lds-adapters-uiapi": "^1.360.0",
36
- "@salesforce/lds-bindings": "^1.360.0",
37
- "@salesforce/lds-instrumentation": "^1.360.0",
35
+ "@salesforce/lds-adapters-uiapi": "^1.360.1",
36
+ "@salesforce/lds-bindings": "^1.360.1",
37
+ "@salesforce/lds-instrumentation": "^1.360.1",
38
38
  "@salesforce/user": "0.0.21",
39
39
  "o11y": "250.7.0",
40
40
  "o11y_schema": "256.126.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@salesforce/lds-adapters-graphql": "^1.360.0",
44
- "@salesforce/lds-drafts": "^1.360.0",
45
- "@salesforce/lds-durable-records": "^1.360.0",
46
- "@salesforce/lds-network-adapter": "^1.360.0",
47
- "@salesforce/lds-network-nimbus": "^1.360.0",
48
- "@salesforce/lds-store-binary": "^1.360.0",
49
- "@salesforce/lds-store-nimbus": "^1.360.0",
50
- "@salesforce/lds-store-sql": "^1.360.0",
51
- "@salesforce/lds-utils-adapters": "^1.360.0",
52
- "@salesforce/nimbus-plugin-lds": "^1.360.0",
43
+ "@salesforce/lds-adapters-graphql": "^1.360.1",
44
+ "@salesforce/lds-drafts": "^1.360.1",
45
+ "@salesforce/lds-durable-records": "^1.360.1",
46
+ "@salesforce/lds-network-adapter": "^1.360.1",
47
+ "@salesforce/lds-network-nimbus": "^1.360.1",
48
+ "@salesforce/lds-store-binary": "^1.360.1",
49
+ "@salesforce/lds-store-nimbus": "^1.360.1",
50
+ "@salesforce/lds-store-sql": "^1.360.1",
51
+ "@salesforce/lds-utils-adapters": "^1.360.1",
52
+ "@salesforce/nimbus-plugin-lds": "^1.360.1",
53
53
  "babel-plugin-dynamic-import-node": "^2.3.3",
54
54
  "wait-for-expect": "^3.0.2"
55
55
  },
package/sfdc/main.js CHANGED
@@ -44377,7 +44377,75 @@ function filterToPredicates(where, recordType, alias, objectInfoMap, joins, draf
44377
44377
  // in 'Account' has the 'Owner' as the 'RelationshipName', the api name in 'referenceToInfos' is 'User'
44378
44378
  if (fieldInfo.referenceToInfos.length === 1) {
44379
44379
  const childRecordType = fieldInfo.referenceToInfos[0].apiName;
44380
- predicates.push(...filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins));
44380
+ let p = filterToPredicates(where[field], childRecordType, childAlias, objectInfoMap, joins);
44381
+ if (isSinglePredicate(p[0]) && p[0].value === null) {
44382
+ // @W-18311580 - this is a reference field with a null value. We need to ensure that we handle the case
44383
+ // where we are joining to a record that may not exist in our offline database, so we need to detect if
44384
+ // the value is really a null, or if it is a missing record in the offline database.
44385
+ //
44386
+ // This effecitvely adds the following predicates to a "where Contact.Account.Name IS NULL" query:
44387
+ //
44388
+ // AND (
44389
+ // (
44390
+ // json_extract("Contact__c_Account__r".data, '$.fields.Id.value') IS NOT NULL (a)
44391
+ // AND json_extract("Contact__c".data, '$.fields.AccountId.value') IS NOT NULL (b)
44392
+ // )
44393
+ // OR json_extract("Contact__c".data, '$.fields.AccountId.value') IS NULL (c)
44394
+ // )
44395
+ //
44396
+ // Where:
44397
+ // (a) AND (b) ensures we have an account record when it is supposed to exist,
44398
+ // OR (c) if AccountId is null, we know we are not referencing an account record.
44399
+ let notNullPredicate = {
44400
+ type: PredicateType.compound,
44401
+ operator: 'and',
44402
+ children: [
44403
+ {
44404
+ alias: alias,
44405
+ leftPath: leftPath,
44406
+ operator: 'IS NOT',
44407
+ value: null,
44408
+ dataType: 'String',
44409
+ type: PredicateType.single,
44410
+ isCaseSensitive: true,
44411
+ },
44412
+ {
44413
+ alias: childAlias,
44414
+ leftPath: `$.fields.Id.value`,
44415
+ operator: 'IS NOT',
44416
+ value: null,
44417
+ dataType: 'String',
44418
+ type: PredicateType.single,
44419
+ isCaseSensitive: true,
44420
+ },
44421
+ ],
44422
+ };
44423
+ let nullPredicate = {
44424
+ type: PredicateType.compound,
44425
+ operator: 'or',
44426
+ children: [
44427
+ notNullPredicate,
44428
+ {
44429
+ alias: alias,
44430
+ leftPath: leftPath,
44431
+ operator: 'IS',
44432
+ value: null,
44433
+ dataType: 'String',
44434
+ type: PredicateType.single,
44435
+ isCaseSensitive: true,
44436
+ },
44437
+ ],
44438
+ };
44439
+ let compoundPredicate = {
44440
+ type: PredicateType.compound,
44441
+ operator: 'and',
44442
+ children: [...p, nullPredicate],
44443
+ };
44444
+ predicates.push(compoundPredicate);
44445
+ }
44446
+ else {
44447
+ predicates.push(...p);
44448
+ }
44381
44449
  }
44382
44450
  else {
44383
44451
  // @W-12618378 polymorphic query sometimes does not work as expected on server. The GQL on certain entities could fail.
@@ -53681,7 +53749,6 @@ class RecordLoaderSOQLComposite extends NetworkRecordLoader {
53681
53749
  }
53682
53750
  }
53683
53751
  const query = `SELECT ${fields.join(',')} FROM ${batch.type} `;
53684
- // console.log(`DUSTIN: soql batch query: ${query}`);
53685
53752
  return query;
53686
53753
  }
53687
53754
  generateWhere(ids) {
@@ -55736,4 +55803,4 @@ register({
55736
55803
  });
55737
55804
 
55738
55805
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, registerReportObserver, reportGraphqlQueryParseError };
55739
- // version: 1.360.0-580249acee
55806
+ // version: 1.360.1-509ca55373