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

G3X Touch events mislabeled #54

Open
davidlav opened this issue Nov 15, 2021 · 9 comments
Open

G3X Touch events mislabeled #54

davidlav opened this issue Nov 15, 2021 · 9 comments

Comments

@davidlav
Copy link

Describe the bug
There are 12 events that support the stock G3X Touch display (used in the X Cub and VL-3). 11 of them are erroneously prefixed with an underscore.

Steps To Reproduce
See lines 1666 - 1676 of events.txt (below). You'll see they begin with an underscore character.

https://github.com/MobiFlight/MobiFlight-Connector/blob/dc5772bdf38e63c91d8d30512109913e37f6ce1e/MSFS2020-module/mobiflight-event-module/modules/events.txt#L1666-L1676

Expected behavior
They should instead look like the one correctly-name event, orphaned by itself on line 1865 (below).

https://github.com/MobiFlight/MobiFlight-Connector/blob/dc5772bdf38e63c91d8d30512109913e37f6ce1e/MSFS2020-module/mobiflight-event-module/modules/events.txt#L1865

Additional context
Hubhop has them named correctly, without prefixed underscores:

image

@JaimeLeon2
Copy link

JaimeLeon2 commented Nov 16, 2021

The issue is that the event name was prefixed by a space when created and Hubhop converts spaces in the names to underscores. Solution is to delete the space in front. I have fixed the preceding space in Hubhop. Hubhop should now generate the correct name for events.txt.

@davidlav
Copy link
Author

Ah, okay. Thanks.

Can I suggest that you add calling trim() on input values to avoid this in the future?

I was the one who added those values to Hubhob originally and never realized I was pasting unnecessary white space in there in the first place.

Appreciate the fix though!

@MobiFlight-Admin
Copy link
Collaborator

Adding trim does make sense, on creating and as well as on exporting. Just in case

@MobiFlight-Admin MobiFlight-Admin transferred this issue from MobiFlight/MobiFlight-Connector Nov 17, 2021
@MobiFlight-Admin
Copy link
Collaborator

I moved the issue to the Hubhop Repository

@rofl-er
Copy link
Contributor

rofl-er commented Nov 17, 2021

Thanks. Can you check what you can do in the exporter, @MobiFlight-Admin ?

@JaimeLeon2
Copy link

I think the correct solution is to not allow the event names to start or end with spaces or any special characters, only alpha numeric, when the events are created, rather than patching it on export.

@MobiFlight-Admin
Copy link
Collaborator

I agree, sanitizing input should be done on saving... but even there it could be on API level or the front end or both.

API is probably the better spot because we can submit stuff without UI too

@rofl-er
Copy link
Contributor

rofl-er commented Oct 26, 2024

Leading/Trailing Spaces are now removed and only RPN Syntax is allowed in the code. Special characters are removed from the label.

@rofl-er
Copy link
Contributor

rofl-er commented Oct 26, 2024

@MobiFlight-Admin - close the issue if you are happy with it

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

4 participants