Skip to content

use Websocket to publish Qos1 message cause function_clause for emqx_coap subscriber #113

@WengangChen

Description

@WengangChen

emqx_coap_mqtt_adapter.erl:

proto_deliver_ack(#message{qos = ?QOS_0}, Proto) ->
    Proto;
proto_deliver_ack(#message{qos = ?QOS_1, headers = #{packet_id := PacketId}}, Proto) ->
    case emqx_protocol:received(?PUBACK_PACKET(PacketId), Proto) of
        {ok, NewProto} -> NewProto;
        Other          -> error(Other)
    end;
proto_deliver_ack(#message{qos = ?QOS_2, headers = #{packet_id := PacketId}}, Proto) ->
    case emqx_protocol:received(?PUBREC_PACKET(PacketId), Proto) of
        {ok, NewProto} ->
            case emqx_protocol:received(?PUBCOMP_PACKET(PacketId), NewProto) of
                {ok, CurrentProto} -> CurrentProto;
                Another            -> error(Another)
            end;
        Other -> error(Other)
    end.

but Websocket send message without packet_id in headers.

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions