Skip to content

fix: hide internal error details in responses and await socket check in translation API - #4596

Merged
SteRiccio merged 1 commit into
masterfrom
fix/hide-internal-error-details-and-await-socket-check
Oct 29, 2026
Merged

SteRiccio merged 1 commit into
masterfrom
fix/hide-internal-error-details-and-await-socket-check

Conversation

@SteRiccio

Copy link
Copy Markdown
Member

Problem

  • Response.sendErr returned any unexpected error as Could not serve: ${err.toString()}. For Postgres errors that exposes table, column and constraint names to the client.
  • translationApi checked !WebSocketServer.isSocketConnected(socketId) without await. isSocketConnected became async with the multi-dyno WebSocket work, so the negated Promise was always false and the "socket missing" check never fired: translations ran even when no socket could receive the result.

Fix

  • Unexpected errors are logged server-side (stack included) and the client receives appErrors:generic with text: 'Internal server error'. SystemError, arena-core's SystemError and UnauthorizedError responses are unchanged.
  • Add the missing await.

The same error-detail fix for the error middleware in arena-server is in openforis/arena-server#225.

Tests

ESLint and Prettier pass on the changed files. I did not run the unit, integration or e2e suites locally.

…in translation API

- sendErr returned unexpected errors as 'Could not serve: <error>', exposing
  table, column and constraint names; they are now logged and the client gets
  a generic message
- translationApi negated the Promise returned by the now async
  WebSocketServer.isSocketConnected, so the missing-socket check never fired
@sonarqubecloud

Copy link
Copy Markdown

@mergify

mergify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@SteRiccio
SteRiccio merged commit e54d9dd into master Oct 29, 2026
14 checks passed
@SteRiccio
SteRiccio deleted the fix/hide-internal-error-details-and-await-socket-check branch October 29, 2026 21:22
SteRiccio added a commit that referenced this pull request Oct 30, 2026
* fix: send error details to the client again in sendErr

Unexpected error details help find the related log entry when a user reports
an error. The server-side log line added in #4596 is kept.

* fix: avoid throwing in sendErr when the error is null

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@SteRiccio SteRiccio mentioned this pull request Oct 30, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant