-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Client
behaviour can now be used with use
#178
base: main
Are you sure you want to change the base?
Conversation
d143a9f
to
9c5fe75
Compare
catch | ||
:error, reason -> {:error, reason} | ||
:exit, reason -> {:exit, reason} | ||
err -> err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually say this is the feature of the client. Thw whole purpose here was to guard the user from doing stupid things that completely severe the connection to NervesHub and leave their device in a bricked state unable to get a remote update.
Switching to the use
model makes sense, but I think we need to find a way to have this protection still. With the proposed changes, every direct call on the client in the socket has the potential to blow up and kill it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nerves is smart with rollbacks to previous versions, would that not possibly help?
could we do the smart logic in the areas that the methods are called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nerves can be smart with rollbacks, but it's only default in bbb
. Most systems need to implement that logic/behavior.
And yes, totally can do the smart logic in the areas. Sorry my comment wasn't totally clear but the intention was definitely "there was a reason we did this, so lets make sure we think of that reason where things are being called"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally get cha
maybe everywhere one of these methods are called we wrap that call instead? we could call it trap_errors
?
this allows for people to use the defaults, and override the implementations they want without having to implement all of them. the `ClientTest` no longer really makes sense, so I've removed it
9c5fe75
to
3880ee2
Compare
This allows people to use the defaults and override the implementations they want without having to implement all of them.
The
ClientTest
no longer really makes sense, so I've removed it.This does remove the function value checking that
apply_wrap
was doing, although I think its fair that this be a responsibility of people implementing the behaviour or overriding the default.