You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case that there is a single level wildcard somewhere in the topic the fixes provided by #418 won't work
For example when i subscribe to foo/+/bar/# and publish on foo/something/bar
-> if (topicName.charAt(topicPos - 1) == '/' && topicFilter.charAt(filterPos) == '#')
this returns false, because the topicFilter at filterPos is / and not #
-> if (topicFilter.length() - filterPos > 1 && topicFilter.substring(filterPos, filterPos + 2).equals("/#"))
returns false, because topicFilter length - filterPos is exactly 1
-> if ((topicFilter.length() - topicName.length()) == 2 && topicFilter.substring(topicFilter.length() - 2, topicFilter.length()).equals("/#"))
returns false, because topicFilter length - topicName length is negative the length of the word that replaces the single level wildcard plus 3 ( 1 for the single level wildcard and 2 for the /#)
Bug exists Release Version 1.2.5 ( Master Branch)
Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
The text was updated successfully, but these errors were encountered:
In the case that there is a single level wildcard somewhere in the topic the fixes provided by #418 won't work
For example when i subscribe to foo/+/bar/# and publish on foo/something/bar
-> if (topicName.charAt(topicPos - 1) == '/' && topicFilter.charAt(filterPos) == '#')
this returns false, because the topicFilter at filterPos is / and not #
-> if (topicFilter.length() - filterPos > 1 && topicFilter.substring(filterPos, filterPos + 2).equals("/#"))
returns false, because topicFilter length - filterPos is exactly 1
-> if ((topicFilter.length() - topicName.length()) == 2 && topicFilter.substring(topicFilter.length() - 2, topicFilter.length()).equals("/#"))
returns false, because topicFilter length - topicName length is negative the length of the word that replaces the single level wildcard plus 3 ( 1 for the single level wildcard and 2 for the /#)
The text was updated successfully, but these errors were encountered: