Increase LiveView socket timeout to 60 seconds

- Set websocket timeout to 60000ms in endpoint configuration
- Add timeout option to LiveSocket client configuration
- Fixes timeout errors during initial map load with large packet count
This commit is contained in:
Graham McIntire 2025-10-25 10:54:22 -05:00
parent 571814c080
commit 93902c043a
No known key found for this signature in database
2 changed files with 2 additions and 1 deletions

View file

@ -304,6 +304,7 @@ let liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500, longPollFallbackMs: 2500,
params: { _csrf_token: csrfToken }, params: { _csrf_token: csrfToken },
hooks: Hooks, hooks: Hooks,
timeout: 60000, // 60 second timeout for slow initial loads
}); });
// Show progress bar on live navigation and form submits // Show progress bar on live navigation and form submits

View file

@ -13,7 +13,7 @@ defmodule AprsmeWeb.Endpoint do
] ]
socket "/live", Phoenix.LiveView.Socket, socket "/live", Phoenix.LiveView.Socket,
websocket: [connect_info: [session: @session_options]], websocket: [connect_info: [session: @session_options], timeout: 60_000],
longpoll: [connect_info: [session: @session_options]] longpoll: [connect_info: [session: @session_options]]
# Serve at "/" the static files from "priv/static" directory. # Serve at "/" the static files from "priv/static" directory.