Skip to main content
Version: 4.36.0

Client Error Reporting to neo-backend

Version: 4.36.0 Date: 2026-04-16

Goal: Make task failures visible to the team by automatically reporting errors to the central API, instead of keeping them silently in local NeDB.

Solution: Added a reportClientError API call and hooked it into the task pipeline so any upload failure is pushed to POST /api/v2/client-errors in a fire-and-forget fashion.

Features:

  • Task failures are automatically reported to neo-backend
  • Error payload includes app version, task type, serialized error chain, and OS/arch context
  • Fire-and-forget: reporting never blocks the task flow or crashes the app if the backend is unreachable
  • Deduplication via module-level Set<string> to prevent multiple reports across pipeline calls

Implementation Details:

  • New reportClientError(payload) function POSTs to ${API_BASE_URL_V2}/client-errors using existing wrap() with auth Bearer
  • Hooked into updateTaskPipe tap callback: triggers when task.status === Failure && task.error
  • Set is cleared on task retry (createTaskPipe with existing _id)

Files Modified:

  • src/protocol/bcyipApi.ts - New reportClientError function + ClientErrorPayload interface
  • src/services/fileProtect/taskActions.pipe.ts - Report on failure in tap callback with deduplication