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
Replace / by _ in name to avoid issue when writing the cache file. #3133
base: dev
Are you sure you want to change the base?
Replace / by _ in name to avoid issue when writing the cache file. #3133
Conversation
Hello, @gmsoft-tuxicoman, thank you for helping with the Mycroft project! We welcome everyone To protect yourself, the project, and users of Mycroft technologies we require Please visit https://mycroft.ai/cla to initiate this one-time signing. Thank |
CLA (7-23-2017) |
Voight Kampff Integration Test Succeeded (Results) |
Thanks for flagging this Guy, Also CLA received and you've been added to our list of awesome contributors - our friendly bot will update that shortly. Based on the error message you got I'm wondering if we should use the I'm interested if others want to chime in on this too? |
The only downside on using the complete path is that you might run into the maximum filename length on the OS. |
Couldn't this run into collisions with files with an actual In addition could the same issue also exist on L1022? or is the logic different enough there to not cause this issue? |
Indeed this collision could happen too. Another option is to hash the filename but it makes it harder to identify the right cache file when looking it up in the directory. |
At one point there was actually a hash but it was changed for this exact reason :) |
Then the solution is evident, filename + 8-16 bytes hash :) |
Please review the last commit. It uses basename_<full_path_hash> so that collisions are not possible. |
I think it looks like a good idea. The lint tool thinks the line is too long however and I wonder if a specific hash from hashlib should be used instead of the |
I'm not sure it's a big deal if hash() changes between versions since those cache files gets regenerated each time. |
I was under the impression the cache files remained, at least the .intent files are cached and reused at a later date, and the files generated by the entity-files has the same date as the corresponding .intent file as far as I can see. But I'm not 100% sure on the inner workings of Precise so I may very well be wrong. In any case, I still think it would be nice if the files guaranteed the same hash, even if the files are generated anew on each startup a change in the hash would cause a "duplicate" file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the linting issue (non-aligned followup row which needs to be fixed to satisfy the autobots) I think this looks great.
You should be able to check the file with flake8 locally |
Thanks for the tip ! |
Anything else you need to get this merged ? |
Seems like there are some unittests failing now. Let me know if you need help with them |
Seems to be a tiny lint issue now :( |
Finally ! :) |
Any luck getting this merged ? |
I think it's good to merge, @krisgesling does the Mycroft team agree? |
Grrr - I resolved a merge conflict and now the Github Action is failing. I'll need to fix that first :( |
@krisgesling any luck ? |
@krisgesling any luck merging this ? |
Description
The latest version of homeassistant skills builds an intent file and tries to register it.
However this fails with the following error message :
How to test
Install the latest homeassitant skill (HEAD).
Contributor license agreement signed?
CLA (7-23-2017)