Skip to content

ErrRejectPacket should be returned in PubAck per v5 spec #465

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

Open
SimonMacIntyre opened this issue Mar 24, 2025 · 3 comments
Open

ErrRejectPacket should be returned in PubAck per v5 spec #465

SimonMacIntyre opened this issue Mar 24, 2025 · 3 comments

Comments

@SimonMacIntyre
Copy link
Contributor

server/server.go

Lines 911 to 912 in 8f52b89

} else if errors.Is(err, packets.ErrRejectPacket) {
return nil

The above behaviour is wrong for v5 spec. Currently if this packet code is assigned to a packet from OnPublish on some custom logic based failure, the expected and desired behaviour is for the ErrRejectPacket to be the reason code used in the PubAck. You can see this in v5 spec here.

Image

Mochi ref to the code:

ErrRejectPacket = Code{Code: 0x83, Reason: "packet rejected"}

@SimonMacIntyre
Copy link
Contributor Author

If maintainers can confirm/agree, I don't mind tackling the PR 🙏

@thedevop
Copy link
Collaborator

Thanks @SimonMacIntyre , this makes sense. Please submit a PR.

@SimonMacIntyre
Copy link
Contributor Author

I haven't forgotten, it's in my todo list :D

If it's urgent to anyone else which seems unlikely, feel free but I should get to this in the next week or two!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants