Ohmbrewer / ohmbrewer

The web application for a happy brew day.
http://ohmbrewer.github.io
0 stars 0 forks source link

Adds jobs for adding and removing Sprouts #62

Closed kyleoliveira closed 8 years ago

kyleoliveira commented 8 years ago

@Ohmbrewer/web-team Got another one for review...

Hold until #59 is merged (may need a rebase afterward).

Resolves #39 . Should provide some buttons on the Rhizome Management page that allow the user to flash Sprouts onto the Rhizome.

Notes:

azyth commented 8 years ago

looks good to me.

azyth commented 8 years ago

my only question pertains to the first note, if you have somethign accessed via a hard coded thing in firmware and it gets deleted, it will hard fault....correct? so we probably need to make sure we dont do that.

kyleoliveira commented 8 years ago

It will only hard fault if you're calling something on a specific Sprout and that Sprout is no longer there. Once the Rhizome is in loop(), all Sprouts are the same.

That's a Rhizome issue, not a web app issue - you'd run into that if you issued the same command the app is issuing but via the Particle CLI or curl. That shouldn't happen usually since the loop is only supposed to have a call to sproutList.work() in it. If you're supplying pre-initialized Sprouts for debugging purposes and are calling something on them manually in loop(), I'd hope you'd guard the call with an if-statement that checks if the pointer isn't NULL and that it still points to what you're thinking it does (i.e. you'd want to loop through the list and find the Sprout with the right Type/ID combo instead of using an index or something) or simply don't modify the Sprout list.