Can't set device name to null

Hello!
I am wondering if it is expected operation to not be able to set a device name back to null? It is clearly supported by the architecture, as it is possible to have many new devices with name ‘null’ visible in particle console, however it seems that once a name has been set, it can’t be changed back to null?
I am getting error Name already in use in response to API calls when I try to do it, and when done via console, it allows me to remove names (setting them to null) which reflects correctly in device list, however upon a hard refresh, it reverts to the previous name. I need to be able to set device names reliably (as to not trigger ‘Name already in use’ error) when devices are uninstalled (unclaiming them isn’t an option), however it seems incredibly short-sighted to force users to rename removed devices something unique just to fill a field (which is used for nothing besides searching within products, which itself isn’t even necessary since I have no problem adding new devices that were never given a name to products) instead of just allowing the name to be deleted.
I’d rather not clutter up the particle device list with a bunch of names consisting of device IDs or something because I had to do that in order to consistently remove devices, however if that is beyond the capabilities of this API, please let me know.

This logic flawed.
These devices never have a “null” name but don’t have have a name at all (yet).
Once an entry is created that entry mustnot be null - further more it even has to be unique across the respective account.
So even if you could set an empty name you’d only be allowed one such device in your account.

There currently is no way to remove a previously created entry.

Imagine an SQL table with the name field marked unique and not-null.
As long there is no row for a particular device all fields (including name) would return null but once a row is created you’ll never be able to get null stored in the DB again.
And for the lack of a DELETE API this will be so as long the device exists.

This might be true for your use case but not for others.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.