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

add optional payload to ACK #347

Merged
merged 2 commits into from Aug 12, 2020
Merged

Conversation

mattkrick
Copy link
Contributor

Sometimes, it's nice to send a payload with an ACK.
A good example might be a JWT, in case the one the client is using is about to expire.
Another example might be the app version, which allows you to upgrade the client without requiring a refresh (this pairs nicely with the built-in reconnect logic).

I think you guys were thinking about doing this, too, because I noticed a payload field for ACKs already exists in the tests: https://github.com/apollographql/subscriptions-transport-ws/blob/master/src/test/tests.ts#L282

@apollo-cla
Copy link

@mattkrick: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@mattkrick
Copy link
Contributor Author

all tests pass locally, gonna close & reopen until tests complete under the 2000ms limit...

@mattkrick mattkrick closed this Feb 3, 2018
@mattkrick mattkrick reopened this Feb 3, 2018
baconz pushed a commit to PhiloInc/subscriptions-transport-ws that referenced this pull request Apr 24, 2018
* micro is only supported in node 6 or greater
* update dependencies
* working Graphiql Server
* updated changelog
* fix linting errors
* adding micro to test suite
* added micro example
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 idea @mattkrick, thanks for this (and sorry for the long delay here!).

@hwillson hwillson merged commit 0ce7a1e into apollographql:master Aug 12, 2020
@nuragic
Copy link

nuragic commented Jun 11, 2021

@mattkrick How do you send a payload from the server on ACK? Is there any way via the public API?

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.

None yet

4 participants