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

Fix TypeError for number values in settings #2258

Merged
merged 1 commit into from Aug 17, 2019
Merged

Conversation

krisgesling
Copy link
Contributor

In some instances, the backend returns number setting values as an integer rather than a string.

This seems to be the quickest fix for it, but worth investigating further from the backend.

How to test

This has been seen in the wild but has been difficult to replicate. The circumstances under which it happens are still unclear. I was able to semi-consistently have a number returned as int from the Severe Weather Skill when editing an unrelated setting. To test, remove the 3 character country code ([A-Z]{3} - ) from the service options of this skill .

Contributor license agreement signed?

In some instances, the backend returns number setting values as an integer rather than a string.

This has been seen in the wild but has been difficult to replicate. The circumstances under which it happens are still unclear. I was able to semi-consistently have a number returned as int from the [Severe Weather Skill](https://github.com/domcross/severe-weather-information-skill) when editing an unrelated setting. To test, remove the 3 character country code (`[A-Z]{3} - `) from the service options of this skill .

This seems to be the quickest fix for it, but worth investigating further from the backend.
@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Aug 16, 2019
@krisgesling
Copy link
Contributor Author

@chrisveilleux - just FYI - I ran into the same TypeError reported by malevolent in the chat today

@chrisveilleux
Copy link
Member

@chrisveilleux - just FYI - I ran into the same TypeError reported by malevolent in the chat today

Yeah, I am of the opinion that the logic in core needs to be changed. I am working on a change right now that plays more nicely with the backend. This will do as a temp fix until I can get my new thing working.

@forslund
Copy link
Collaborator

@chrisveilleux Just remember that the backend needs to be backwards compatible and should send these numbers as strings so older versions of core will still work.

@forslund forslund merged commit dd36678 into dev Aug 17, 2019
@forslund forslund deleted the fix/number-setting-values branch August 19, 2019 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants