Decide which status a lost server connection shows #330

Closed
opened 2026-10-29 09:08:32 +01:00 by nessar · 1 comment
Owner

Follow-up from #319 / PR #328 (#320).

Current behaviour

A connection lost after the first server message gives an incomplete calculation. It keeps the best valid plan already received, and there is no retry, as #319 user story 11 asks. The coordinator's failure handling was kept unchanged, so the reason code is worker-error. CalendarYear.hasPlannerError counts worker-error as a planner error. The person therefore sees the alert "The planner encountered an unexpected error." (fr: "Le planificateur a rencontré une erreur inattendue.") above the retained plan.

Story 11 instead describes an incomplete calculation that the person decides whether to calculate again. A network drop is not a planner defect.

Options

  1. Keep worker-error. No change. The status stays an error alert, as for a crashed local worker.
  2. Add a dedicated reason, e.g. connection-lost. The remote job reports it when the socket closes after the first message. The UI shows it as a warning-level incomplete calculation, with a short "calculate again" hint. This needs:
    • the worker-job failure callback to carry a reason;
    • a matching branch in the coordinator;
    • one translated string in each of the four languages.

Recommendation

Option 2. The person can act on it, and it keeps planner errors meaningful.

To decide

  • Option 1 or option 2.
  • If option 2: the reason code name and the message wording, in English and French at least.
Follow-up from #319 / PR #328 (#320). ## Current behaviour A connection lost after the first server message gives an incomplete calculation. It keeps the best valid plan already received, and there is no retry, as #319 user story 11 asks. The coordinator's failure handling was kept unchanged, so the reason code is `worker-error`. `CalendarYear.hasPlannerError` counts `worker-error` as a planner error. The person therefore sees the alert "The planner encountered an unexpected error." (fr: "Le planificateur a rencontré une erreur inattendue.") above the retained plan. Story 11 instead describes an incomplete calculation that the person decides whether to calculate again. A network drop is not a planner defect. ## Options 1. **Keep `worker-error`.** No change. The status stays an error alert, as for a crashed local worker. 2. **Add a dedicated reason, e.g. `connection-lost`.** The remote job reports it when the socket closes after the first message. The UI shows it as a warning-level incomplete calculation, with a short "calculate again" hint. This needs: - the worker-job failure callback to carry a reason; - a matching branch in the coordinator; - one translated string in each of the four languages. ## Recommendation Option 2. The person can act on it, and it keeps planner errors meaningful. ## To decide - Option 1 or option 2. - If option 2: the reason code name and the message wording, in English and French at least.
nessar added the needs-triage label 2026-10-29 09:08:32 +01:00
Author
Owner

Decision: option 2, landing in PR #328.

  • Reason code connection-lost. The remote job reports it when the socket closes after the first server message. Close codes 1011, 1008, 1003, 1007 and 1009 (server-reported faults) and unparseable server messages stay worker-error. Only onclose decides, so onerror no longer wins the race and hides the close code.
  • The 30 s liveness watchdog stays worker-error: from the client, silence cannot be told apart from a stuck server worker.
  • Shown as a warning-level incomplete calculation (role=status) with the best valid plan kept. One key, planning.connectionLost, used with or without a retained plan:
    • en: Connection to the server lost. Use “Calculate plan” to try again.
    • fr: Connexion au serveur perdue. Utilisez « Calculer le planning » pour réessayer.
    • de: Verbindung zum Server verloren. Mit „Plan berechnen“ erneut versuchen.
    • es: Se perdió la conexión con el servidor. Use «Calcular plan» para intentarlo de nuevo.
  • Only plan jobs use it. Counterfactual and explain-checkpoint jobs keep their generic failures.
  • CONTEXT.md: Incomplete calculation now says every interruption, including a lost connection, exposes the best available valid plan.
Decision: option 2, landing in PR #328. - Reason code connection-lost. The remote job reports it when the socket closes after the first server message. Close codes 1011, 1008, 1003, 1007 and 1009 (server-reported faults) and unparseable server messages stay worker-error. Only onclose decides, so onerror no longer wins the race and hides the close code. - The 30 s liveness watchdog stays worker-error: from the client, silence cannot be told apart from a stuck server worker. - Shown as a warning-level incomplete calculation (role=status) with the best valid plan kept. One key, planning.connectionLost, used with or without a retained plan: - en: Connection to the server lost. Use “Calculate plan” to try again. - fr: Connexion au serveur perdue. Utilisez « Calculer le planning » pour réessayer. - de: Verbindung zum Server verloren. Mit „Plan berechnen“ erneut versuchen. - es: Se perdió la conexión con el servidor. Use «Calcular plan» para intentarlo de nuevo. - Only plan jobs use it. Counterfactual and explain-checkpoint jobs keep their generic failures. - CONTEXT.md: Incomplete calculation now says every interruption, including a lost connection, exposes the best available valid plan.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/vac-optimizer#330