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

improve(desktop): improve experience with avro #1762

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Conversation

LAST7
Copy link
Collaborator

@LAST7 LAST7 commented Sep 20, 2024

PR Checklist

Does this PR introduce a breaking change?

  • Yes
  • No

Specific Instructions

Are there any specific instructions or things that should be known prior to review?

Other information

@LAST7 LAST7 self-assigned this Sep 20, 2024
@LAST7
Copy link
Collaborator Author

LAST7 commented Sep 20, 2024

Something weird happens when importing 'xxx.json' file as avro schema. Though the filename readed from the file system ends with '.json', a '.avsc' is added to the end of the filename: renaming it to 'xxx.json.avsc' after it's journey to the database.

Howerver, since the filtering logic of selecting imported schema is by examining their extensions, this strange 'xxx.json.avsc' name surprisingly does not require any further processing to be listed in the options in the schema tab.

That being said, I still hope the reason of this strange process to be found.

@LAST7 LAST7 changed the title Improve improve(desktop): improve experience with avro Sep 20, 2024
@ysfscream ysfscream added enhancement New feature or request desktop MQTTX Desktop labels Sep 20, 2024
@ysfscream ysfscream added this to the v1.11.0 milestone Sep 20, 2024
Editor lang for protobuf schema is set to 'plaintext'
@ysfscream ysfscream merged commit 1eeb231 into emqx:main Sep 23, 2024
2 checks passed
@ysfscream
Copy link
Member

Something weird happens when importing 'xxx.json' file as avro schema. Though the filename readed from the file system ends with '.json', a '.avsc' is added to the end of the filename: renaming it to 'xxx.json.avsc' after it's journey to the database.

I will test locally to find the issue. Thanks for your report.

@ysfscream
Copy link
Member

@LAST7, in this PR #1764, I fixed the issue of file extensions. This isn't a strange problem. In the code, every import automatically adds a suffix.

However, there needs to be a solution with logical judgment. So, I made a quick fix. Briefly speaking, it checks if the file extension is correct. If it's incorrect, it deletes it and adds the expected suffix. Although the .json suffix is legal in Avro, I still automatically added or retained the .avsc suffix format to be more in line with the specification. I hope this can help you. Thanks!

@LAST7
Copy link
Collaborator Author

LAST7 commented Sep 24, 2024

@LAST7, in this PR #1764, I fixed the issue of file extensions. This isn't a strange problem. In the code, every import automatically adds a suffix.

However, there needs to be a solution with logical judgment. So, I made a quick fix. Briefly speaking, it checks if the file extension is correct. If it's incorrect, it deletes it and adds the expected suffix. Although the .json suffix is legal in Avro, I still automatically added or retained the .avsc suffix format to be more in line with the specification. I hope this can help you. Thanks!

Ah, I see the reason now. THX!

@LAST7 LAST7 deleted the improve branch September 24, 2024 09:34
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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants