Skip to content
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

Bug fixes from recent PRs #1928

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/nerves_hub/deployments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
def broadcast(deployment, event, payload \\ %{})

def broadcast(:none, event, payload) do
Phoenix.Channel.Server.broadcast(

Check warning on line 402 in lib/nerves_hub/deployments.ex

View workflow job for this annotation

GitHub Actions / compile-and-test

Nested modules could be aliased at the top of the invoking module.
NervesHub.PubSub,
"deployment:none",
event,
Expand All @@ -408,7 +408,7 @@
end

def broadcast(:monitor, event, payload) do
Phoenix.Channel.Server.broadcast(

Check warning on line 411 in lib/nerves_hub/deployments.ex

View workflow job for this annotation

GitHub Actions / compile-and-test

Nested modules could be aliased at the top of the invoking module.
NervesHub.PubSub,
"deployment:monitor",
event,
Expand All @@ -417,7 +417,7 @@
end

def broadcast(%Deployment{id: id}, event, payload) do
Phoenix.Channel.Server.broadcast(

Check warning on line 420 in lib/nerves_hub/deployments.ex

View workflow job for this annotation

GitHub Actions / compile-and-test

Nested modules could be aliased at the top of the invoking module.
NervesHub.PubSub,
"deployment:#{id}",
event,
Expand Down Expand Up @@ -458,7 +458,13 @@
when not is_nil(deployment_id) do
{:ok, deployment} = get_deployment_for_device(device)

bad_version = !Version.match?(device_version, deployment.conditions["version"])
bad_version =
if deployment.conditions["version"] != "" do
!Version.match?(device_version, deployment.conditions["version"])
else
false
end

bad_platform = device.firmware_metadata.platform != deployment.firmware.platform
bad_architecture = device.firmware_metadata.architecture != deployment.firmware.architecture

Expand Down
1 change: 1 addition & 0 deletions lib/nerves_hub_web/live/devices/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ defmodule NervesHubWeb.Live.Devices.Index do
|> assign(:total_entries, 0)
|> assign(:current_alarms, Alarms.get_current_alarm_types(product.id))
|> assign(:metrics_keys, Metrics.default_metrics())
|> assign(:deployments, Deployments.get_deployments_by_product(product))
|> assign(:available_deployments_for_filtered_platform, [])
|> assign(:target_deployment, nil)
|> subscribe_and_refresh_device_list_timer()
Expand Down
Loading