Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ws server]: unsubscribe_call to non-active subscription should indicate error #559

Closed
niklasad1 opened this issue Nov 11, 2021 · 1 comment

Comments

@niklasad1
Copy link
Member

niklasad1 commented Nov 11, 2021

		// Subscribe call.
		let sub_resp = rpc
			.call_with("subscribeSomething", Vec::<()>::new())
			.await
			.unwrap();
		let sub_id: SubscriptionId = deser_call(sub_resp);

		// Unsubscribe
		assert_eq!(
			rpc.call_with("unsubscribeSomething", [sub_id.clone()]).await,
			Some(r#"{"jsonrpc":"2.0","result":"Unsubscribed","id":0}"#.into())
		);

		// Should indicate that subscription was already closed and not active anymore!
               // but doesn't
		assert_eq!(
			rpc.call_with("unsubscribeSomething", [sub_id]).await,
			Some("{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32602,\"message\":\"Invalid subscription id.\"},\"id\":1}".into()),
		);
@niklasad1
Copy link
Member Author

Closed by #561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant