Skip to content

Commit

Permalink
Fix UpdateManager calling handle_fwup_message on fwup success
Browse files Browse the repository at this point in the history
UpdateManager was calling `handle_fwup_message` with `string()`
instead of the tuple `{:ok, 0, string()}`. This looks like a
bug because the default client does not have a handler for
`handle_fwup_message(string())`. Instead the default handler
is called and a warning message is logged during successful
firmware update.
  • Loading branch information
bmteller authored and mobileoverlord committed Jun 4, 2020
1 parent 6c643f1 commit 0fbab61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nerves_hub_link/update_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ defmodule NervesHubLink.UpdateManager do
{:reply, status, state}
end

def handle_info({:fwup, {:ok, 0, message}}, state) do
def handle_info({:fwup, {:ok, 0, _message} = full_message}, state) do
Logger.info("[NervesHubLink] FWUP Finished")
_ = Client.handle_fwup_message(message)
_ = Client.handle_fwup_message(full_message)
Nerves.Runtime.reboot()
{:noreply, state}
end
Expand Down

0 comments on commit 0fbab61

Please sign in to comment.