-
Notifications
You must be signed in to change notification settings - Fork 94
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
No Duplicate flag in paho Publish struct #162
Comments
I think you mean Unfortunately the way the flags (DUP, QoS & RETAIN) work is a bit of a hack (as PUBLISH is the only packet that uses the fixed header for flags). I think this would need to be well commented to because it's dangerous for users to trust the flag (at QOS1 they may, or may not have seen the packet before; at QOS2 the library should not deliver duplicate packets). Adding this would also allow users to set it prior to calling |
Yep, edited. 😅
I see, I don't see an urgent need to address this, but I thought I'd open the issue to note it. Regarding the issue of users being able to set it, I don't think that's a big deal. That's a benign flag to set. |
I was more concerned about user perception (see a |
Note that there is a related bug here; when reading a publish packet the QOS field is set but DUP (and RETAIN) fields are not. This bit me in a test in my repo (fixed the DUP one there). Not really related to the above but another bug that bit me while testing is here |
Following PR #172 |
I feel there should at least be a code comment in (This could also be a good first issue for someone else) |
@vishnureddy17 I've proposed a solution (made this read only as allowing users set the flag is likely to lead to confusion). |
Currently,
Publish
in cp_publish.go does not have a Duplicate field. It would be useful for the users to be able to see that field to check if this is a retried publish.The text was updated successfully, but these errors were encountered: