Skip to content

Export: surface failures to users + log to Azure (sync USFM export) #195

Description

@henrique221

Problem

The synchronous USFM export the editor uses (fluent-web useExportUsfm
POST /project-units/{id}/usfm) has two gaps:

  1. fluent-web omits credentials. useExportUsfm.ts is the only API call in
    the app missing credentials: 'include'. It works today only because the
    endpoint is unauthenticated — once fix(auth): require authentication on bibles and USFM routes #189's auth merges, this request 401s and
    the editor export breaks.
    Must ship with (or before) fix(auth): require authentication on bibles and USFM routes #189's deploy.
  2. Failures are invisible. The hook throws a generic
    Error('Failed to export USFM'); the UI surfaces nothing actionable, and the
    API doesn't consistently log the failure to App Insights.

Decision (Kasey, 2026-06-18)

improve the user experience to let them know that an error occurred … it should
log to Azure like other things.

Scope

  • fluent-web: add credentials: 'include'; surface a retryable error state in
    ExportProjectDialog.
  • fluent-api: log sync-export failures via the standard logger → App Insights
    with project-unit context; stop returning raw error.message/details to the
    client (align with the { message } envelope — breaking change, coordinate
    with fluent-web).

⚠️ Release coupling: the fluent-web credentials fix must land no later than
#189's auth change.

Refs

Follow-up from the security/export audit (#194, PR #189).
Detail: docs/proposals/security-and-export-hardening/02-export-error-ux-and-logging.md.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions