Brewskey / spark-server

An API compatible open source server for interacting with devices speaking the spark-protocol
https://www.particle.io/
GNU Affero General Public License v3.0
54 stars 27 forks source link

variables data lost on update device name #241

Closed durielz closed 7 years ago

durielz commented 7 years ago

Hi guys, if i update my device name using PUT /devices/:deviceId then I lose the variables attribute in the device attributes data. I think the problem is in the updateByID method in DeviceAttributeDatabaseRepository.js which gets undefined variables data

jlkalberer commented 7 years ago

So... in the public server variables/functions are not actually saved to the DB. I am not sure what I like better :/

I'd love to hear other people's opinions on this.

Also, @AntonPuko - I've noticed that sometimes devices are added and don't have a name. Can you make sure all code-paths for create/update always pass in a name? I would say "move it to the repository" but I think that isn't the correct place for it.

AntonPuko commented 7 years ago

@jlkalberer Hm, I can't reproduce the no name on create issue and can't find a place where it can be failed. May be you remember some circumstances?