Skip to content
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

Duplicate MQTT SUBSCRIBE for persistent sessions #1912

Open
JuliusFruitfly opened this issue Nov 13, 2024 · 2 comments
Open

Duplicate MQTT SUBSCRIBE for persistent sessions #1912

JuliusFruitfly opened this issue Nov 13, 2024 · 2 comments

Comments

@JuliusFruitfly
Copy link

Owntracks seems to re-issue subscriptions for a persistent mqtt session even when the protocol version is set to 4 (3.1.1) and the 'session present' flag is set in the CONNACK

This is a shame as it generates a lot of traffic on an unreliable connection

Thanks.

  • App build number: 2.5.3 (420503003)
  • Android version: 14
  • Device: Xiaomi/Redmi Note 12
  • Installation source: Google Play
@growse
Copy link
Collaborator

growse commented Nov 23, 2024

It's a good shout - we always re-subscribe on reconnect.

The problem with only doing that when cleanSession=true is that if the broker is not persisting state, if the broker restarts, then it'll lose the session and no messages will be received by OT until it explicitly resubscribes. OT has no way of knowing when it reconnects whether or not a broker is holding an existing session, hence we always subscribe.

Could have it as a config setting for people who explicitly want to turn this behaviour off?

@JuliusFruitfly
Copy link
Author

JuliusFruitfly commented Nov 24, 2024 via email

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