-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Topic selector in subscription API not working #706
Comments
Me too. With the same Mercure hub version out of Docker, SF 5.4.13. |
There's something with the topic selector. Look at this example with 2 subscribers filtering with the "teste" topic which returns some other topics. Response from: http://127.0.0.1:55009/.well-known/mercure/subscriptions {
"@context": "https://mercure.rocks/",
"id": "/.well-known/mercure/subscriptions",
"type": "Subscriptions",
"lastEventID": "urn:uuid:fbf6a829-f040-48e0-9a4c-7de0f2054d09",
"subscriptions": [
{
"id": "/.well-known/mercure/subscriptions/teste/urn%3Auuid%3Aa80e910f-5f52-444d-982e-a56715246c14",
"type": "Subscription",
"subscriber": "urn:uuid:a80e910f-5f52-444d-982e-a56715246c14",
"topic": "teste",
"active": true
},
{
"id": "/.well-known/mercure/subscriptions/%2Fbooks%2F2/urn%3Auuid%3Aa80e910f-5f52-444d-982e-a56715246c14",
"type": "Subscription",
"subscriber": "urn:uuid:a80e910f-5f52-444d-982e-a56715246c14",
"topic": "/books/2",
"active": true
},
{
"id": "/.well-known/mercure/subscriptions/%2Fconfig%2F1234/urn%3Auuid%3Aa80e910f-5f52-444d-982e-a56715246c14",
"type": "Subscription",
"subscriber": "urn:uuid:a80e910f-5f52-444d-982e-a56715246c14",
"topic": "/config/1234",
"active": true
},
{
"id": "/.well-known/mercure/subscriptions/http%3A%2F%2F127.0.0.1%2F54bbb590-6a19-470f-a836-9dce7a3fc514/urn%3Auuid%3A495ea86d-dc94-472c-8fdb-ba22ac9d447e",
"type": "Subscription",
"subscriber": "urn:uuid:495ea86d-dc94-472c-8fdb-ba22ac9d447e",
"topic": "http://127.0.0.1/54bbb590-6a19-470f-a836-9dce7a3fc514",
"active": true,
"payload": {
"remoteAddr": "127.0.0.1",
"user": "https://example.com/users/dunglas"
}
}
]
} Response filtering the topic "teste" should not return other topics. http://127.0.0.1:55009/.well-known/mercure/subscriptions/teste: {
"@context": "https://mercure.rocks/",
"id": "/.well-known/mercure/subscriptions/teste",
"type": "Subscriptions",
"lastEventID": "urn:uuid:deb3110f-d862-4c9c-accd-9493db72b0be",
"subscriptions": [
{
"id": "/.well-known/mercure/subscriptions/teste/urn%3Auuid%3A4c70ca4e-64fa-49a7-bae5-49f00f80db25",
"type": "Subscription",
"subscriber": "urn:uuid:4c70ca4e-64fa-49a7-bae5-49f00f80db25",
"topic": "teste",
"active": true
},
{
"id": "/.well-known/mercure/subscriptions/%2Fbooks%2F2/urn%3Auuid%3A4c70ca4e-64fa-49a7-bae5-49f00f80db25",
"type": "Subscription",
"subscriber": "urn:uuid:4c70ca4e-64fa-49a7-bae5-49f00f80db25",
"topic": "/books/2",
"active": true
},
{
"id": "/.well-known/mercure/subscriptions/%2Fconfig%2F1234/urn%3Auuid%3A4c70ca4e-64fa-49a7-bae5-49f00f80db25",
"type": "Subscription",
"subscriber": "urn:uuid:4c70ca4e-64fa-49a7-bae5-49f00f80db25",
"topic": "/config/1234",
"active": true
}
]
} Mercure 0.14.5, SF 5.4 |
Here's my proposed fix: #834 |
Sorry for the late reply. I have tested it again with v0.18.1 and now it works. Thank you very much! |
I'm playing aroung with the subscription API and I think that the topic selector is not working properly. Fetching the subscription API with a topic selector in
mercure/examples/chat/static/chat.js
Line 15 in 7df3818
subscriptions
array.Can be reproduced here: https://demo-chat.mercure.rocks/
I have the same problem locally with mercure v0.14.1. I suspect that the encoded slash (
%2F
) is not working. Using topic selectors without slash works, but the result is not filtered. It is the same as calling/.well-known/mercure/subscriptions
without a topic.The text was updated successfully, but these errors were encountered: