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

bug: updating a non existing subscriptions returns no error #2315

Closed
fbarbu15 opened this issue Dec 22, 2023 · 2 comments
Closed

bug: updating a non existing subscriptions returns no error #2315

fbarbu15 opened this issue Dec 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@fbarbu15
Copy link
Contributor

To reproduce

Follow the requests shown in those tests logs.

INFO     src.node.api_clients.base_client:base_client.py:11 POST call: http://127.0.0.1:47362/relay/v1/subscriptions with payload: ["/waku/2/rs/0/1"]
INFO     src.node.api_clients.base_client:base_client.py:22 Response status code: 200. Response content: b'true'
INFO     src.node.api_clients.base_client:base_client.py:11 POST call: http://127.0.0.1:38749/filter/v2/subscriptions with payload: {"requestId": "b69f8790-fdd2-4409-b418-0fedfa0eb35f", "contentFilters": ["/test/1/waku-filter/proto"], "pubsubTopic": "/waku/2/rs/0/1"}
INFO     src.node.api_clients.base_client:base_client.py:22 Response status code: 200. Response content: b'{"requestId":"b69f8790-fdd2-4409-b418-0fedfa0eb35f","statusCode":0,"statusDesc":""}'
INFO     src.node.api_clients.base_client:base_client.py:11 PUT call: http://127.0.0.1:38749/filter/v2/subscriptions with payload: {"requestId": "1", "contentFilters": ["/test/2/waku-filter/proto"]}
INFO     src.node.api_clients.base_client:base_client.py:22 Response status code: 200. Response content: b'{"requestId":"1","statusCode":0,"statusDesc":""}'

Actual behavior

Notice that the PUT request doesn't even have a pubsubTopic and the response is 200 without any statusDesc

Expected behavior

I would expect some kind of error should notify the user that such subscription doesn't existt

nwaku version/commit hash

harbor.status.im/wakuorg/nwaku:latest

@fbarbu15 fbarbu15 added the bug Something isn't working label Dec 22, 2023
@fbarbu15
Copy link
Contributor Author

Same issue if we try to create a subscription with no pubsubtopic:

INFO     src.node.api_clients.base_client:base_client.py:11 POST call: http://127.0.0.1:23639/filter/v2/subscriptions with payload: {"requestId": "1", "contentFilters": ["/test/1/waku-filter/proto"]}
INFO     src.node.api_clients.base_client:base_client.py:22 Response status code: 200. Response content: b'{"requestId":"1","statusCode":0,"statusDesc":""}'

@NagyZoltanPeter
Copy link
Contributor

NagyZoltanPeter commented Jan 16, 2024

@fbarbu15 :
This is actually a feature that expected to work like this.
Some explanation:

  • POST / PUT filter v2 subscribe is just mimic normal REST API behavior, but actually does the same. Both can create and add to subscriptions regardless if peer is already subcribed or not. Actually it is bacuase of the Filter V2 protocol design that does not allows it else.
    Note that there was a discussion already to remove PUT operation from filter v2 subscribe to eliminate this missunderstanding.

About the subscribe with empty pubsub-topic is a valid subscription for filter v2. Actually it behaves the same as for relay.
When you do not provide pubsub-topic it handle it as auto-sharded subscription and will calculate the shards upon the content-topic provided and subscribes to all shards of it.
I hope it answers. Please let me know if we need to still change anything.

@chair28980 chair28980 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants