[ST Edge] Issue with profile names

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:

  1. The validation of profile name for fingerprint and for profile itself are different.
    Profile validator accepts longer names
  2. 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.
  3. 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.
  4. 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

1 Like

Ok, as I understand, the remaining request is that you’re not able to delete a device profile after you packaged the driver, right?

Removing a device profile from the package is not currently supported. This is to avoid inconsistencies because we could delete a profile used by a device accidentally and that would leave it in a weird state.
However, I will create a feature request for the engineering team, so they can analyze it.

To avoid causing issues with the driver used by others, I suggest you use a separate driver and channel for development, once you verify everything works correctly, you can add the new values to the shared driver.

Thank you @nayelyz

However, there is an additional thing.
If the packaging fails for whatever reason, I would expect that nothing would be published.
Currently the packaging failure is actually treated as a partial success, as profiles from the driver are getting published, even though the new driver version was not

1 Like

ok, thank you for the info.
I already reported both situations, one as a feature request (delete the profile) and the other one as an issue (partial package of the driver).
As soon as I get feedback from any of them, I’ll share it with you.

1 Like

Great, thank you @nayelyz

1 Like