@salesforce/lds-runtime-mobile 1.155.0 → 1.156.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 +41 -33
  2. package/package.json +1 -1
  3. package/sfdc/main.js +41 -33
package/dist/main.js CHANGED
@@ -4053,38 +4053,32 @@ function recordQuery(selection, apiName, alias, predicates, input) {
4053
4053
  const draftsField = { type: FieldType.Scalar, extract, path: 'node._drafts' };
4054
4054
  const idExtract = { type: ValueType.Extract, jsonAlias: alias, field: 'Id' };
4055
4055
  const idField = { type: FieldType.Scalar, extract: idExtract, path: 'node.Id' };
4056
- // When the exclude stale records gate is open, inject an additional predicate
4057
- // to limit the search to records that either have drafts associated to them or
4058
- // were ingested at least as recently as the query.
4059
- if (excludeStaleRecordsGate.isOpen({ fallback: false })) {
4060
- const key = input.connectionKeyBuilder(selection, input.config.variables);
4061
- const queryMetadata = input.metadata[key];
4062
- // If there is no metadata for this query or it somehow lacks a timestamp
4063
- // skip adding the additional predicates
4064
- if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
4065
- const timestamp = queryMetadata.ingestionTimestamp;
4066
- const timestampCheck = {
4067
- type: PredicateType$1.comparison,
4068
- left: {
4069
- type: ValueType.Extract,
4070
- jsonAlias: alias,
4071
- field: 'ingestionTimestamp',
4072
- metadata: true,
4073
- },
4074
- operator: ComparisonOperator.gte,
4075
- right: { type: ValueType.IntLiteral, value: timestamp },
4076
- };
4077
- const isDraft = {
4078
- type: PredicateType$1.nullComparison,
4079
- left: { type: ValueType.Extract, jsonAlias: alias, field: 'drafts' },
4080
- operator: NullComparisonOperator.isNot,
4081
- };
4082
- predicates.push({
4083
- type: PredicateType$1.compound,
4084
- operator: CompoundOperator.or,
4085
- children: [timestampCheck, isDraft],
4086
- });
4087
- }
4056
+ // When the exclude stale records gate is open and there is a root timestamp
4057
+ // in the parser input, inject an additional predicate to limit the search
4058
+ // to records that either have drafts associated to them or were ingested at
4059
+ // least as recently as the query.
4060
+ if (excludeStaleRecordsGate.isOpen({ fallback: false }) && input.rootTimestamp !== undefined) {
4061
+ const timestampCheck = {
4062
+ type: PredicateType$1.comparison,
4063
+ left: {
4064
+ type: ValueType.Extract,
4065
+ jsonAlias: alias,
4066
+ field: 'ingestionTimestamp',
4067
+ metadata: true,
4068
+ },
4069
+ operator: ComparisonOperator.gte,
4070
+ right: { type: ValueType.IntLiteral, value: input.rootTimestamp },
4071
+ };
4072
+ const isDraft = {
4073
+ type: PredicateType$1.nullComparison,
4074
+ left: { type: ValueType.Extract, jsonAlias: alias, field: 'drafts' },
4075
+ operator: NullComparisonOperator.isNot,
4076
+ };
4077
+ predicates.push({
4078
+ type: PredicateType$1.compound,
4079
+ operator: CompoundOperator.or,
4080
+ children: [timestampCheck, isDraft],
4081
+ });
4088
4082
  }
4089
4083
  return queryContainer(internalFields, alias, apiName, predicates).map((result) => {
4090
4084
  const { fields, predicates } = result;
@@ -4134,6 +4128,20 @@ function rootRecordQuery(selection, input) {
4134
4128
  if (input.objectInfoMap[alias] === undefined) {
4135
4129
  return failure([missingObjectInfo(apiName)]);
4136
4130
  }
4131
+ // When the exclude stale records gate is open and the query has an
4132
+ // ingestion timestamp in its cache metadata, associate that with the input
4133
+ // so it can later be used to limit the search to records were ingested at
4134
+ // least as recently as the query.
4135
+ if (excludeStaleRecordsGate.isOpen({ fallback: false })) {
4136
+ const key = input.connectionKeyBuilder(selection, input.config.variables);
4137
+ const queryMetadata = input.metadata[key];
4138
+ // If there is no metadata for this query or it somehow lacks a timestamp
4139
+ // skip setting the root timestamp
4140
+ if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
4141
+ // subtract 10ms from timestamp to account for ingestion processing time
4142
+ input.rootTimestamp = queryMetadata.ingestionTimestamp - 10;
4143
+ }
4144
+ }
4137
4145
  return recordQuery(selection, alias, apiName, [], input);
4138
4146
  }
4139
4147
  function rootQuery(recordNodes, input) {
@@ -15976,4 +15984,4 @@ register({
15976
15984
  });
15977
15985
 
15978
15986
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15979
- // version: 1.155.0-96e212d1e
15987
+ // version: 1.156.1-7842b5df6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.155.0",
3
+ "version": "1.156.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
package/sfdc/main.js CHANGED
@@ -4053,38 +4053,32 @@ function recordQuery(selection, apiName, alias, predicates, input) {
4053
4053
  const draftsField = { type: FieldType.Scalar, extract, path: 'node._drafts' };
4054
4054
  const idExtract = { type: ValueType.Extract, jsonAlias: alias, field: 'Id' };
4055
4055
  const idField = { type: FieldType.Scalar, extract: idExtract, path: 'node.Id' };
4056
- // When the exclude stale records gate is open, inject an additional predicate
4057
- // to limit the search to records that either have drafts associated to them or
4058
- // were ingested at least as recently as the query.
4059
- if (excludeStaleRecordsGate.isOpen({ fallback: false })) {
4060
- const key = input.connectionKeyBuilder(selection, input.config.variables);
4061
- const queryMetadata = input.metadata[key];
4062
- // If there is no metadata for this query or it somehow lacks a timestamp
4063
- // skip adding the additional predicates
4064
- if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
4065
- const timestamp = queryMetadata.ingestionTimestamp;
4066
- const timestampCheck = {
4067
- type: PredicateType$1.comparison,
4068
- left: {
4069
- type: ValueType.Extract,
4070
- jsonAlias: alias,
4071
- field: 'ingestionTimestamp',
4072
- metadata: true,
4073
- },
4074
- operator: ComparisonOperator.gte,
4075
- right: { type: ValueType.IntLiteral, value: timestamp },
4076
- };
4077
- const isDraft = {
4078
- type: PredicateType$1.nullComparison,
4079
- left: { type: ValueType.Extract, jsonAlias: alias, field: 'drafts' },
4080
- operator: NullComparisonOperator.isNot,
4081
- };
4082
- predicates.push({
4083
- type: PredicateType$1.compound,
4084
- operator: CompoundOperator.or,
4085
- children: [timestampCheck, isDraft],
4086
- });
4087
- }
4056
+ // When the exclude stale records gate is open and there is a root timestamp
4057
+ // in the parser input, inject an additional predicate to limit the search
4058
+ // to records that either have drafts associated to them or were ingested at
4059
+ // least as recently as the query.
4060
+ if (excludeStaleRecordsGate.isOpen({ fallback: false }) && input.rootTimestamp !== undefined) {
4061
+ const timestampCheck = {
4062
+ type: PredicateType$1.comparison,
4063
+ left: {
4064
+ type: ValueType.Extract,
4065
+ jsonAlias: alias,
4066
+ field: 'ingestionTimestamp',
4067
+ metadata: true,
4068
+ },
4069
+ operator: ComparisonOperator.gte,
4070
+ right: { type: ValueType.IntLiteral, value: input.rootTimestamp },
4071
+ };
4072
+ const isDraft = {
4073
+ type: PredicateType$1.nullComparison,
4074
+ left: { type: ValueType.Extract, jsonAlias: alias, field: 'drafts' },
4075
+ operator: NullComparisonOperator.isNot,
4076
+ };
4077
+ predicates.push({
4078
+ type: PredicateType$1.compound,
4079
+ operator: CompoundOperator.or,
4080
+ children: [timestampCheck, isDraft],
4081
+ });
4088
4082
  }
4089
4083
  return queryContainer(internalFields, alias, apiName, predicates).map((result) => {
4090
4084
  const { fields, predicates } = result;
@@ -4134,6 +4128,20 @@ function rootRecordQuery(selection, input) {
4134
4128
  if (input.objectInfoMap[alias] === undefined) {
4135
4129
  return failure([missingObjectInfo(apiName)]);
4136
4130
  }
4131
+ // When the exclude stale records gate is open and the query has an
4132
+ // ingestion timestamp in its cache metadata, associate that with the input
4133
+ // so it can later be used to limit the search to records were ingested at
4134
+ // least as recently as the query.
4135
+ if (excludeStaleRecordsGate.isOpen({ fallback: false })) {
4136
+ const key = input.connectionKeyBuilder(selection, input.config.variables);
4137
+ const queryMetadata = input.metadata[key];
4138
+ // If there is no metadata for this query or it somehow lacks a timestamp
4139
+ // skip setting the root timestamp
4140
+ if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
4141
+ // subtract 10ms from timestamp to account for ingestion processing time
4142
+ input.rootTimestamp = queryMetadata.ingestionTimestamp - 10;
4143
+ }
4144
+ }
4137
4145
  return recordQuery(selection, alias, apiName, [], input);
4138
4146
  }
4139
4147
  function rootQuery(recordNodes, input) {
@@ -15976,4 +15984,4 @@ register({
15976
15984
  });
15977
15985
 
15978
15986
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15979
- // version: 1.155.0-96e212d1e
15987
+ // version: 1.156.1-7842b5df6