Skip to content

Connection closed when subscribing in QoS2 from a non-clean session #1003

@gmondada

Description

@gmondada

System Information

  • Aedes: 0.51.3
  • NodeJS: 20.16.0
  • OS: Windows 10
  • Arch: x86_64

Describe the bug
I open a session in clean=false mode.
I subscribe to a retained topic in QoS 2.
I expect to get a message from that topic because retained.
I do not get any message. In aedes log I see the client being disconnected and reconnected again.

To Reproduce
Here is a test program that reproduces the problem: https://github.com/gmondada/aedes/blob/gm-tests/test2.js
You can run it in this way:

git clone https://github.com/gmondada/aedes.git
cd aedes
git checkout gm-tests
npm i
node test2.js

Expected behavior
The test program above (test2.js) creates a broker instance, then creates a client publishing a retained topic, then creates 3 clients subscribing to that topic with different parameters. I expect to have all clients receiving the retained topic. The last one does not.
The client not receiving the topic is connected in clean=false mode and subscribes in QoS 2.

Additional context
I use a simple aedes instance, with no persistence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions