-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Allow MQTT topic to have wildcards (# or +) #5398
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
base: 2.1.X
Are you sure you want to change the base?
Conversation
This should fix louislam#1669
So that when wildcards for monitoring are used, the full published topic is displayed.
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.
Looks reasonable.
I have added one question below where I am a bit confused.
I have not looked into if this is a v2.0 (Bugfix of something in the beta) or v2.1 (new feature) PR
|
||
describe("MqttMonitorType", { | ||
concurrency: true, | ||
concurrency: 4, |
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.
What is the background behind this change? How was 4 chosen? 🤔
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.
I almost doubled the number of tests in this describe
. For each test, a HiveMQ docker container is started. With concurrency: true
, they are all started at the same time.
My powerful laptop and servers didn't like too much starting 13 containers at exactly the same time. The test suite needed over 2 minutes, and sometimes didn't even return at all. With concurrency: 4
, the suite consistently required ~22s, which cannot get much better with a 20s timeout. There are 3 timeout tests, so concurrency: 3
would probably be fine as well. Anything more than 4 and I'd be afraid to DDOS other computers when testing.
As you wish. Since the core of this bugfix is basically just removing one |
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.
I am treating this as a feature
=> putting it into the v2.1 release window.
Co-authored-by: Frank Elsinga <[email protected]>
…m#5476) Co-authored-by: Frank Elsinga <[email protected]>
…t cause catastophic backtracking (ReDOS) (louislam#5573) Co-authored-by: Frank Elsinga <[email protected]>
Solved by #6043 if merged @CommanderStorm @EricDuminil |
Thanks for pointing out that they conflict. @lupaulus @EricDuminil So which of the two should we keep? |
@EricDuminil @CommanderStorm Mine is ready, here they are conflicts, it need to be adapted. As for me, as long it works, it is ok. But it need to be added for 2.0.0 milestone |
Neither will be added to the v2.0 milestone, sorry. Once we have released the milestone, we can start adding features again |
@CommanderStorm @lupaulus The notification conflicts seem to come from unrelated commits which have been added to my PR. Sorry, I don't know anything about them. My original commits can be seen at master...EricDuminil:uptime-kuma:275ab89e62 The tests are important IMHO, and try to send MQTT messages to both valid and invalid topics, with corresponding assertions. As for the code itself: I don't think regexen are needed at all. If |
@CommanderStorm Should I rebase this PR? |
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
Fixes #1669 : MQTT topic couldn't contain any wildcard, due to a too restrictive check.
If a message was received, it means the topic was correct, which means no further check is required.
The change is small enough that I took the liberty to not start a discussion first.
Type of change
Checklist
Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.