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

getuserlist mqtt command doesn't return expected list #596

Closed
pshotton opened this issue May 25, 2023 · 1 comment
Closed

getuserlist mqtt command doesn't return expected list #596

pshotton opened this issue May 25, 2023 · 1 comment

Comments

@pshotton
Copy link

When I issue the mqtt command getuserlist it doesn't provide the documented response. Instead it provides a steadily growing list of uids as follows:
{"list":[{"uid":"3495223"},{"uid":"3440285"},{"uid":"3216488"},{"uid":"3555367"},{"uid":"3406010"},{"uid":"3330112"},{"uid":"8887412"},{"uid":"9211455"},{"uid":"9205583"},{"uid":"13037518"},{"uid":"8874809"},{"uid":"9230373"}]} {"list":[{"uid":"3495223"},{"uid":"3440285"},{"uid":"3216488"},{"uid":"3555367"},{"uid":"3406010"},{"uid":"3330112"},{"uid":"8887412"},{"uid":"9211455"},{"uid":"9205583"},{"uid":"13037518"},{"uid":"8874809"},{"uid":"9230373"}]} {"list":[{"uid":"3495223"},{"uid":"3440285"},{"uid":"3216488"},{"uid":"3555367"},{"uid":"3406010"},{"uid":"3330112"},{"uid":"8887412"},{"uid":"9211455"},{"uid":"9205583"},{"uid":"13037518"},{"uid":"8874809"},{"uid":"9230373"}]}
Looking at the code it doesn't appear to be doing what I'd expect (but I'm no javascript programmer).
What seems to be happening is that the getUserList method creates a root document, and for each uid, adds the uid to the root document and then publishes it. The full detail is read and decoded but never sent.
I think the
mqttPublishEvent(&root);
should be
mqttPublishEvent(&json);
but I don't want to break my working lock system to try it out. Interested in other's views.

@matjack1
Copy link
Collaborator

This is fixed in the dev branch already :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants