relay-runtime 0.0.0-main-ba09a889 → 0.0.0-main-dce1a2ea

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/experimental.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-ba09a889
2
+ * Relay v0.0.0-main-dce1a2ea
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-ba09a889
2
+ * Relay v0.0.0-main-dce1a2ea
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -179,7 +179,7 @@ var Executor = /*#__PURE__*/function () {
179
179
  }
180
180
  case 'loading_final':
181
181
  {
182
- activeState = this._pendingModulePayloadsCount > 0 ? 'active' : 'inactive';
182
+ activeState = this._pendingModulePayloadsCount > 0 || this._useExecTimeResolvers && !this._execTimeResolverResponseComplete ? 'active' : 'inactive';
183
183
  break;
184
184
  }
185
185
  default:
@@ -374,8 +374,10 @@ var Executor = /*#__PURE__*/function () {
374
374
  this._getPublishQueueAndSaveActor().commitPayload(this._operation, payload, this._updater);
375
375
  _payloadFollowups.push(payload);
376
376
  this._execTimeResolverResponseComplete = isFinal;
377
+ if (isFinal) {
378
+ this._updateActiveState();
379
+ }
377
380
  }
378
- this._processPayloadFollowups(_payloadFollowups);
379
381
  }
380
382
  if (incrementalResponses.length > 0) {
381
383
  var _payloadFollowups2 = this._processIncrementalResponses(incrementalResponses);
@@ -619,7 +621,7 @@ var Executor = /*#__PURE__*/function () {
619
621
  });
620
622
  };
621
623
  _proto._maybeCompleteSubscriptionOperationTracking = function _maybeCompleteSubscriptionOperationTracking() {
622
- if (!this._isSubscriptionOperation && !(this._useExecTimeResolvers && this._execTimeResolverResponseComplete)) {
624
+ if (!this._isSubscriptionOperation && !(this._useExecTimeResolvers && this._execTimeResolverResponseComplete && this._state === 'loading_final')) {
623
625
  return;
624
626
  }
625
627
  if (this._pendingModulePayloadsCount === 0 && this._incrementalPayloadsPending === false) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relay-runtime",
3
3
  "description": "A core runtime for building GraphQL-driven applications.",
4
- "version": "0.0.0-main-ba09a889",
4
+ "version": "0.0.0-main-dce1a2ea",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -323,7 +323,11 @@ class Executor<TMutation: MutationParameters> {
323
323
  }
324
324
  case 'loading_final': {
325
325
  activeState =
326
- this._pendingModulePayloadsCount > 0 ? 'active' : 'inactive';
326
+ this._pendingModulePayloadsCount > 0 ||
327
+ (this._useExecTimeResolvers &&
328
+ !this._execTimeResolverResponseComplete)
329
+ ? 'active'
330
+ : 'inactive';
327
331
  break;
328
332
  }
329
333
  default:
@@ -585,8 +589,12 @@ class Executor<TMutation: MutationParameters> {
585
589
  );
586
590
  payloadFollowups.push(payload);
587
591
  this._execTimeResolverResponseComplete = isFinal;
592
+ if (isFinal) {
593
+ // Need to update the active state to mark the query as inactive,
594
+ // incase server payloads have completed
595
+ this._updateActiveState();
596
+ }
588
597
  }
589
- this._processPayloadFollowups(payloadFollowups);
590
598
  }
591
599
 
592
600
  if (incrementalResponses.length > 0) {
@@ -949,7 +957,11 @@ class Executor<TMutation: MutationParameters> {
949
957
  _maybeCompleteSubscriptionOperationTracking() {
950
958
  if (
951
959
  !this._isSubscriptionOperation &&
952
- !(this._useExecTimeResolvers && this._execTimeResolverResponseComplete)
960
+ !(
961
+ this._useExecTimeResolvers &&
962
+ this._execTimeResolverResponseComplete &&
963
+ this._state === 'loading_final'
964
+ )
953
965
  ) {
954
966
  return;
955
967
  }