Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Don't handle promisedParams error twice #514

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

benjie
Copy link
Contributor

@benjie benjie commented Feb 28, 2019

If promisedParams resolves to an exception then the error will be handled twice; once here:

if (e.errors) {
this.sendMessage(connectionContext, opId, MessageTypes.GQL_DATA, { errors: e.errors });
} else {
this.sendError(connectionContext, opId, { message: e.message });
}
// Remove the operation on the server side as it will be removed also in the client
this.unsubscribe(connectionContext, opId);

and once here:

// Handle initPromise rejected
this.sendError(connectionContext, opId, { message: error.message });
this.unsubscribe(connectionContext, opId);

this PR resolves that issue. It's a very minor fix, so shouldn't require any test changes.

TODO:

  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thanks @benjie!

@hwillson hwillson merged commit 2a14451 into apollographql:master Aug 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants