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] Enhance JSON syntax error messages #1361

Closed
ysfscream opened this issue Jul 17, 2023 · 0 comments · Fixed by #1383 or #1384
Closed

[Feature] Enhance JSON syntax error messages #1361

ysfscream opened this issue Jul 17, 2023 · 0 comments · Fixed by #1383 or #1384
Assignees
Labels
desktop MQTTX Desktop enhancement New feature or request feature This pr is a feature
Milestone

Comments

@ysfscream
Copy link
Member

Currently, in MQTTX, when the selected data format for receipt is JSON, but the received data is not in JSON format, numerous error pop-ups are triggered. This can lead to a frustrating user experience as it lacks optimization. There is a need for more specific error messages for each incorrect message, including during script processing, instead of multiple pop-up alerts.

Image

Detailed Design

To resolve this issue, I propose improving JSON syntax error messages in MQTTX. We can handle syntax errors more gracefully by providing detailed error messages for each incorrect message directly in the message stream, instead of triggering multiple pop-up alerts.

We can add a dedicated error-handling mechanism that will:

  • Check if the received message follows the JSON format if JSON is selected as the data format.
  • Display an error message directly within the message stream, below script processing prompts, instead of a pop-up, to avoid style conflicts.
  • The error message should specify the exact issue with the message's syntax, with a message similar to: "Used JSON format, and syntax error: xxx".

With these modifications, users can directly view the specific error information in the message stream without going through pop-up alerts. This not only lowers the usage difficulty for the user but also makes viewing error information more intuitive.

Image

Alternatives

An alternative solution could be to ignore non-JSON formatted messages when JSON is selected as the data format. However, this could lead to confusion and missed data for the user. Another alternative is to keep the current system with multiple pop-ups, but as stated, this could lead to a frustrating user experience.

More detail (optional)

This feature would require a modification in the way MQTTX processes incoming messages and how it handles syntax errors. A new error-handling mechanism would need to be developed to check the syntax of incoming messages and provide detailed error messages directly in the message stream.

This feature aims to enhance the user experience by providing more specific and less intrusive error messages, thus making MQTTX more user-friendly and efficient.

@ysfscream ysfscream added this to MQTTX Jul 17, 2023
@ysfscream ysfscream converted this from a draft issue Jul 17, 2023
@ysfscream ysfscream added enhancement New feature or request feature This pr is a feature desktop MQTTX Desktop labels Jul 17, 2023
@ysfscream ysfscream added this to the v1.9.5 milestone Jul 17, 2023
@ysfscream ysfscream moved this from TO DO to In Progress in MQTTX Jul 31, 2023
@ysfscream ysfscream moved this from In Progress to TO DO in MQTTX Jul 31, 2023
@ni00 ni00 linked a pull request Aug 1, 2023 that will close this issue
2 tasks
@github-project-automation github-project-automation bot moved this from TO DO to Done in MQTTX Aug 1, 2023
@ni00 ni00 linked a pull request Aug 1, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop enhancement New feature or request feature This pr is a feature
Projects
Archived in project
2 participants