The MQTT v5 specification disallows subscribing to shared subscriptions with the No Local option, ant it defines this as a Protocol Error. As defined in the section 4.13.1 of the specification, to be compliant with the specification a client must not send packets that may cause Protocol Errors. The client should therefore test this case before sending the packet to the server, which is then forced to close the connection.
Section 3.8.3.1: "It is a Protocol Error to set the No Local bit to 1 on a Shared Subscription 2127 [MQTT-3.8.3-4]."
Section 4.13.1: "If the sender is compliant with this specification it will not send Malformed Packets or cause Protocol Errors."
Section 4.13.1: "When a Server detects a Malformed Packet or Protocol Error, and a Reason Code is given in the specification, it MUST close the Network Connection [MQTT-4.13.1-1]. In the case of an error in a CONNECT packet it MAY send a CONNACK packet containing the Reason Code, before closing the Network Connection. In the case of an error in any other packet it SHOULD send a DISCONNECT packet containing the Reason Code before closing the Network Connection. Use Reason Code 0x81 (Malformed Packet) or 0x82 (Protocol Error) unless a more specific Reason Code has been defined."
[X] Bug exists Release Version 1.2.5 ( Master Branch)
The MQTT v5 specification disallows subscribing to shared subscriptions with the No Local option, ant it defines this as a Protocol Error. As defined in the section 4.13.1 of the specification, to be compliant with the specification a client must not send packets that may cause Protocol Errors. The client should therefore test this case before sending the packet to the server, which is then forced to close the connection.