mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
T8: the invalid-FEN flash is generic; the client message and FEN go to the log. A2: an expired confirmation link says so and lands on log-in, where an unconfirmed account resends the email. W3: the connection banner gains Reload and Home actions. D1: a failed export logs and redirects to the data tab with a support address instead of a bare 500. D2: an unknown export format renders the styled 404. H1: the empty-database home CTA points at the guest trainer instead of auth-gated /endgames. X2/X3: the importer hides inspect(reason) behind generic copy and logs it. Adds coverage for the T8 copy, A2 destination, D2 404 page, H1 CTA and the W3 actions; the H1 tests now restore the curated-code override so async page tests cannot poison each other.
This commit is contained in:
@@ -8,6 +8,8 @@ defmodule ChesstrainerWeb.EndgameLive.Import do
|
||||
|
||||
use ChesstrainerWeb, :live_view
|
||||
|
||||
require Logger
|
||||
|
||||
alias Chesstrainer.Endgames.BulkImport
|
||||
alias Chesstrainer.Endgames.Tablebase.Local
|
||||
|
||||
@@ -268,7 +270,14 @@ defmodule ChesstrainerWeb.EndgameLive.Import do
|
||||
end
|
||||
|
||||
def handle_async(:lookup, {:exit, reason}, socket) do
|
||||
{:noreply, put_flash(socket, :error, "Could not look up the FENs: #{inspect(reason)}")}
|
||||
Logger.error("bulk_import.lookup_failed", reason: inspect(reason))
|
||||
|
||||
{:noreply,
|
||||
put_flash(
|
||||
socket,
|
||||
:error,
|
||||
"The lookup failed. Try again; if it keeps happening, check the server log."
|
||||
)}
|
||||
end
|
||||
|
||||
defp tablebase_status do
|
||||
@@ -284,7 +293,8 @@ defmodule ChesstrainerWeb.EndgameLive.Import do
|
||||
{:error, "Local tablebase is not configured. Set TABLEBASE_PATH to enable imports."}
|
||||
|
||||
{:error, reason} ->
|
||||
{:error, "Local tablebase failed to load: #{inspect(reason)}"}
|
||||
Logger.warning("bulk_import.tablebase_unavailable", reason: inspect(reason))
|
||||
{:error, "The local tablebase failed to load. Check TABLEBASE_PATH and the server log."}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -197,12 +197,10 @@ defmodule ChesstrainerWeb.EndgameLive.PlayCore do
|
||||
end
|
||||
|
||||
def fen_invalid(socket, %{"fen" => fen, "message" => message}) do
|
||||
Logger.warning("board.fen_invalid", fen: fen, message: message)
|
||||
|
||||
{:noreply,
|
||||
put_flash(
|
||||
socket,
|
||||
:error,
|
||||
"Endgame FEN is invalid and the board cannot be loaded: #{message} (#{fen})"
|
||||
)}
|
||||
put_flash(socket, :error, "The board couldn't load this position. Reset to try again.")}
|
||||
end
|
||||
|
||||
def reset(socket) do
|
||||
|
||||
Reference in New Issue
Block a user