diff --git a/assets/src/hooks/v2/use_api_response.tsx b/assets/src/hooks/v2/use_api_response.tsx index 79f38b0d9..812f129d0 100644 --- a/assets/src/hooks/v2/use_api_response.tsx +++ b/assets/src/hooks/v2/use_api_response.tsx @@ -6,6 +6,8 @@ import { isDup, isOFM, isTriptych, getTriptychPane } from "Util/outfront"; import { getScreenSide, isRealScreen } from "Util/util"; import * as SentryLogger from "Util/sentry"; import { ROTATION_INDEX } from "Components/v2/dup/rotation_index"; +import { DUP_VERSION } from "Components/v2/dup/version"; +import { TRIPTYCH_VERSION } from "Components/v2/triptych/version"; const MINUTE_IN_MS = 60_000; @@ -131,14 +133,12 @@ const getRequestorParam = () => { const getLoggingParams = () => { if (isDup()) { - return `&rotation_index=${ROTATION_INDEX}`; + return `&rotation_index=${ROTATION_INDEX}&version=${DUP_VERSION}`; } if (isTriptych()) { const triptychPane = getTriptychPane(); - if (triptychPane != null) { - return `&pane=${triptychPane}`; - } + return `&pane=${triptychPane || "UNKNOWN"}&version=${TRIPTYCH_VERSION}`; } return ""; diff --git a/lib/screens/log_screen_data.ex b/lib/screens/log_screen_data.ex index 9f8679791..df32945d7 100644 --- a/lib/screens/log_screen_data.ex +++ b/lib/screens/log_screen_data.ex @@ -20,7 +20,8 @@ defmodule Screens.LogScreenData do requestor, screen_side \\ nil, rotation_index \\ nil, - triptych_pane \\ nil + triptych_pane \\ nil, + ofm_app_package_version \\ nil ) do if is_screen or not is_nil(requestor) do data = @@ -33,6 +34,7 @@ defmodule Screens.LogScreenData do |> insert_requestor(requestor) |> insert_dup_rotation_index(rotation_index) |> insert_triptych_pane(triptych_pane) + |> insert_version(ofm_app_package_version) log_message("[screen data request]", data) end @@ -149,4 +151,7 @@ defmodule Screens.LogScreenData do defp insert_triptych_pane(data, triptych_pane), do: Map.put(data, :triptych_pane, triptych_pane) + + defp insert_version(data, nil), do: data + defp insert_version(data, version), do: Map.put(data, :ofm_app_package_version, version) end diff --git a/lib/screens_web/controllers/v2/screen_api_controller.ex b/lib/screens_web/controllers/v2/screen_api_controller.ex index b30fc61f0..17e1b7f23 100644 --- a/lib/screens_web/controllers/v2/screen_api_controller.ex +++ b/lib/screens_web/controllers/v2/screen_api_controller.ex @@ -23,6 +23,7 @@ defmodule ScreensWeb.V2.ScreenApiController do screen_side = params["screen_side"] rotation_index = params["rotation_index"] triptych_pane = params["pane"] + ofm_app_package_version = params["version"] Screens.LogScreenData.log_data_request( screen_id, @@ -31,7 +32,8 @@ defmodule ScreensWeb.V2.ScreenApiController do params["requestor"], screen_side, rotation_index, - triptych_pane + triptych_pane, + ofm_app_package_version ) cond do