-
Notifications
You must be signed in to change notification settings - Fork 0
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
Is test for subscriptions wrong? #3
Comments
Any comment on this? Thinking about this further, the better option is definitely to change test\query\subscriptions.ts from:
to:
If the 'params' were instead made empty, any other Nodes registered with the server would be immediately sent as an initial sync grain, rather than waiting for the matching Node to be registered. |
Thank you for reporting this issue. We think the test case is wrong, as you pointed out. We're going to check this in detail soon (the specification seems to be a bit unclear here). Adding more test cases is planed to cover "params" in general. |
Thanks for the confirmation, Simon. I agree the behaviour required by the spec for the WebSockets is quite complex. Just three examples: (1) Connections made to a subscription with a large max_update_rate_ms should in some cases not be sent data grains at the same time. (2) Non-persistent subscriptions with no connections should be expired after some time (I picked default of 12s, matching node health). (3) Supporting HTTP GET 'Upgrade' to WebSocket to create a non-persistent subscription seems unclear to me - I think an 'Upgrade' request should probably result in a redirect response in our case where websockets are being served from a different port than the Query API. Maybe we can contribute to the test cases. |
The test case "should get subscription notification via websocket when adding a resource" seems wrong to me.
test\query\subscriptions.ts has:
test\resources\node.json has:
If I understand correctly, with these data, the node does not match the subscription parameters, so no notification should be received. If the testSubscription were changed to have 'params': {} or 'params': { 'label': 'TestNode1' }, then the notification should be received.
Thanks.
The text was updated successfully, but these errors were encountered: