Skip to content

Commit 0823eff

Browse files
committed
chore: Add error logging
1 parent 1eb04d2 commit 0823eff

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎lib/octocon_web/user_socket.ex‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ defmodule OctoconWeb.UserChannel do
6969
version_str -> Version.parse(version_str)
7070
end
7171

72+
platform = Map.get(params, "platform", "unknown")
73+
force_batch = Map.get(params, "forceBatch", false)
74+
7275
case protocol_version do
7376
{:ok, version} ->
7477
if is_reconnect do
@@ -79,7 +82,7 @@ defmodule OctoconWeb.UserChannel do
7982
# What the fuck
8083
exceeds_ios_limit = :erlang.external_size(init_data) * 1.1 > 1_048_576
8184

82-
if exceeds_ios_limit && version >= @batched_init_version do
85+
if force_batch || (platform == "ios" && exceeds_ios_limit && version >= @batched_init_version) do
8386
send(self(), :send_batched_init)
8487

8588
{:ok, %{@batched_dummy_response | system: init_data["system"]}, socket |> assign(:init_data, init_data)}
@@ -101,7 +104,9 @@ defmodule OctoconWeb.UserChannel do
101104
{:error, %{reason: "unauthorized"}}
102105
end
103106
rescue
104-
_ -> {:error, %{reason: "internal_error"}}
107+
e ->
108+
reraise e, __STACKTRACE__
109+
{:error, %{reason: "internal_error"}}
105110
end
106111

107112
defp generate_init_data(system_id) do

0 commit comments

Comments
 (0)