Hi,
I was trying to add a new device (with a new profile) to the existing driver.
When trying to build a package, I get the following error:
Error: Request failed with status code 400: {"requestId":"964EBA6D-0C6C-473A-B82A-02BCD9E22F5B","error":{"code":"ConstraintViolationError","message":"The request is
malformed.","details":[{"code":"PatternError","target":"fingerprints[3].fingerprintId","message":"fingerprints[3].fingerprintId does not match the pattern ^[a-zA-Z0-9
_/\\-()\\[\\]{}.]{1,36}$.","details":[]}]}}
For the following profile name
Motion Illuminance sensor with battery voltage (YG)
I assume the error is caused by the name is being too long.
So I changed the profile name to be shorter both in fingerprints and in profile.
Now I’m getting
Error: Request failed with status code 400: {"requestId":"26BCA2EE-500B-4159-B5A5-2CB08ABE7EBD","error":{"code":"ConstraintViolationError","message":"The request is
malformed.","details":[{"code":"ConstraintViolationError","target":"Profiles","message":"Profile(s) removed: Motion Illuminance sensor with battery voltage (YG)","details":[]}]}}
FAILED to compile
So, I think there are multiple issues:
- The validation of profile name for fingerprint and for profile itself are different.
Profile validator accepts longer names - The packaging process deploys profiles before it validates that it can be completed successfully.
If packaging fails, I would expect the new profiles would not being published. - It is not possible to fix the driver just by fixing the profile name.
The packaging now requires profile with invalid name to be present in the driver, even though it can not be used by fingerprints. - It is not possible to remove profile from the driver, even though it is not being used by any devices
While it seems like a minor issue during development, that can be fixed by deleting the driver and creating a new one with correct profile names, once the driver is published and is in use by the community the things are quite different.
If I just delete the driver and create a new one, the users would need to manually change the driver for all devices just to get an updated driver version.
This is very unfortunate situation.
Thanks
P.S.
I will probably will need to keep invalid profile in the driver package to workaround this issue
Update:
I did not understand the error correctly. It was caused by too long fingerprint id, not profile name, used in fingerprint. So the #1 is not correct. Sorry about this. However, the other points are still valid