-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: adding filter data admin endpoint (REST) #2314
Conversation
You can find the image built from this PR at
Built from 9e568f7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful PR! Thanks for it! 💯
nitpick: I wonder if we could add more test cases and not only the "happy path" :D
Oh yess, my bad! Copied from another endpoint, adapted it for this case and forgot about adding more 😳 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for it, will be great for debugging as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed only the API details and left a minor comment.
LGTM once that is addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thank you!
I would add an error when filter is not mounted but it's ok for now.
Yes! I was 50-50 whether to return an error stating that filter isn't mounted or to return an empty array of subscribers in that case. I followed the second option just to be consistent with the approach of But I do agree that returning an error stating that the protocol is not even mounted is more informative. @Ivansete-status @NagyZoltanPeter, what do you think? |
My first thought is to return with error and correct explanation. Due this admin endpoint is strictly depends on Filter service to be mounted. Otherwise it has no meaning. Emtpy array would mean to me there is no subscriptions and Filter service is running. |
65f9dfc
to
0012d60
Compare
9252a8e
to
e37a9dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks!
|
||
var subscriptions: seq[FilterSubscription] = @[] | ||
|
||
if not node.wakuFilter.isNil(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be remove since it's checked above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes! Was supposed to remove it but for sure got distracted and forgot 😶
Will fix it now, thanks so much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great!
Just to note to myself, I need to touch here as soon it gets merged - surely before my rework on managing filter subscriptions. that makes filter subscription structure upside-down. :-)
Description
Adding admin REST endpoint to retrieve the serving node's subscriber filter clients and their subscribed pubsub and content topics.
Endpoint: GET /admin/v1/filter/subscriptions
Changes
openapi.yaml
documentationIssue
closes #2290