ErrRejectPacket should be returned in PubAck per v5 spec
https://github.com/mochi-mqtt/server/blob/8f52b891d5d3169340cbfd29cec6a6408ed66f31/server.go#L911-L912
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.
Mochi ref to the code: https://github.com/mochi-mqtt/server/blob/8f52b891d5d3169340cbfd29cec6a6408ed66f31/packets/codes.go#L95-L95
If maintainers can confirm/agree, I don't mind tackling the PR 🙏
Thanks @SimonMacIntyre , this makes sense. Please submit a PR.
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!