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

[Feature] Delete subscribe TOPIC in disconnect. #1308

Closed
WangShuoran opened this issue May 24, 2023 · 6 comments
Closed

[Feature] Delete subscribe TOPIC in disconnect. #1308

WangShuoran opened this issue May 24, 2023 · 6 comments
Assignees
Labels
discussion This issues and pr are worth discussing wontfix This will not be worked on

Comments

@WangShuoran
Copy link

WangShuoran commented May 24, 2023

Motivation

I want to test clean session button behavior, To be precise I want to test do not clear session Impact on subscribe.

But, if I disconnected with my broker, I find I can not delete subscribe TOPIC:
image
image

Detailed design

I want delete subscribe topic in disconnect.

Alternatives

Or add an operation to disable subscribe topic.

@WangShuoran WangShuoran added the feature This pr is a feature label May 24, 2023
@ysfscream
Copy link
Member

Hello! Thank you for your feedback. However, under the current MQTT protocol, we cannot manage the topics of a disconnected client. If the issue is related to the 'clean session' flag, we can discuss it more in-depth.

image

@ysfscream ysfscream self-assigned this May 25, 2023
@ysfscream ysfscream added wontfix This will not be worked on discussion This issues and pr are worth discussing and removed feature This pr is a feature labels May 25, 2023
@WangShuoran
Copy link
Author

我用中文说一下,翻译成英文在下面。

我用Wireshark监听了MQTTX这个工具的使用,我发现在我连接的一瞬间,所有我当前的订阅都会发送订阅报文。

这个现象当然没问题,也是我们编程的顺序。

但是如果我不设置Clean Session时,在下一次连接时,MQTT Broker只要不超时,就会知道MQTT Client依然完成了订阅。

这个现象也是没问题的吧?我说的意思当然不是断开后告诉Broker我要取消订阅,而是在下一次连接时,不然MQTTX发送订阅报文。

I will say it in Chinese and translate it into English below.

I used Wireshark to monitor the use of MQTTX tool and found that at the moment I connected, all my current subscriptions would send subscription messages.

Of course, this phenomenon is not a problem, and it is also the order of our programming.

But if I don't set the Clean Session, the MQTT Broker will know that the MQTT Client has still completed the subscription as long as it doesn't timeout on the next connection.

Is this phenomenon also okay? What I mean, of course, is not to tell the broker after disconnecting that I want to cancel the subscription, but rather to send the subscription message to MQTTX on the next connection.

@ysfscream
Copy link
Member

I apologize for the misunderstanding. The situation you encountered is actually due to the default auto-subscribe setting being turned on in MQTTX. This is a specific behavior of MQTTX, primarily designed to facilitate users to re-subscribe to previous topics when they reconnect. Otherwise, if the clean session is set to true, the topic will become invalid after each disconnection.

image

@WangShuoran
Copy link
Author

谢谢你的快速回复,这个选项当然能替代性的解决我的需求,但是这是我说的在下一次连接时,不让MQTTX发送订阅报文。我明白如果在没有开启Clean Session时,断开连接的时候删除TOPIC会导致再次连接的时候,在消息栏会接收到”没有订阅“的数据(这可能更匪夷所思),可能在之后的用户使用中会有更多的问题。

所以虽然能解决我的细节问题,但是这是在和用户进行讨论,明白用户的真正诉求后,添加的高级选项。虽然这个是免费的工具,但是很多人(包括我)是用这个工具上手MQTT协议的。如果你们愿意让这个工具交互更傻瓜,我认为不能拒绝我的刻意删除操作,或者增加一个提示,告诉我替代办法是你说的内容,否则用户会认为这个不智能。

如果愿意改变,我们可以继续讨论,如果觉得工具已经对这个问题提供解决方案,那么请增加提示。

Thank you for your prompt response. This option can of course replace my needs, but I mentioned that MQTTX should not send subscription messages during the next connection. I understand that deleting TOPIC when disconnected without opening the Clean Session will result in receiving 'unsubscribed' data in the message bar when reconnecting (which may be even more bizarre), which may cause more problems for future users.

So although it can solve my details, this is an advanced option added after discussing with the user and understanding their true needs. Although this is a free tool, many people (including me) have learned about the MQTT protocol using this tool. If you are willing to make the interaction with this tool more foolish, I believe you cannot refuse my deliberate deletion operation, or add a prompt to tell me that the alternative is what you said, otherwise the user will consider it unintelligent.

If you are willing to change, we can continue our discussion. If you feel that the tool has already provided a solution to this problem, please add a prompt.

@ysfscream
Copy link
Member

OK! We will attempt to make the setting more noticeable for users to choose whether to enable auto-resub, such as during subscription, and explain in detail the relationship between this function and Clean Session.
However, we won't be able to implement the deletion of subscriptions upon disconnection. We highly appreciate your suggestion.

@ysfscream ysfscream added this to MQTTX May 25, 2023
@ysfscream ysfscream moved this to To Do in MQTTX May 25, 2023
@WangShuoran
Copy link
Author

Thank you!

@ysfscream ysfscream moved this from Backlog to Done in MQTTX Jul 14, 2023
@ysfscream ysfscream moved this from Done to Reject in MQTTX Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This issues and pr are worth discussing wontfix This will not be worked on
Projects
Status: Reject
Development

No branches or pull requests

2 participants