Skip to content

fix(persistence): keep storage error text out of bulk-submit receipts - #3372

Open
angela-helios wants to merge 2 commits into
mainfrom
fix/3053-bulk-submit-receipt-storage-text
Open

angela-helios wants to merge 2 commits into
mainfrom
fix/3053-bulk-submit-receipt-storage-text

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Closes #3053

Behaviour change to review

  • Bulk-submit per-entry receipts and file error artifacts on PostgreSQL, SQLite, MongoDB and composite storage now say internal storage error; the server log has the detail for a server-side storage fault, where they used to carry the driver or SQL text. The detail is logged at warn. The manifest error message for a file that failed on such a fault carries the same text.
  • StorageError::client_text() now replaces the backend reason of TransactionError::Transient, CommitOutcomeUnknown, RolledBack and TooLargeForCache with a fixed sentence. Its other callers (purge audit descriptions, $reindex status errors, tenant UI alerts, bulk-export audit) change with it.

Summary

Receipts that a submitter downloads from $bulk-submit-status were built from the Display text of StorageError on every backend except S3, so a storage fault put SQL fragments, table and index names or driver text in diagnostics.

Issue codes, line references and the wording of errors about the submitted content (conflicts, invalid resources, parse errors, tenant permission) are unchanged. S3 receipts were already sanitised and are not touched.

Tests

  • New unit tests: client_text on the four transaction variants; the worker's ingest_failure_cause; MongoDB detail, all_failed and insert_failed.
  • Updated: the composite ingest sink rejection test and the composite sync_ingested rejection test now assert the fixed sentence and the absence of the backend's own text; two PostgreSQL savepoint tests that pinned the leaked trigger text now expect the fixed sentence.

Results:

  • cargo test -p helios-persistence --lib with all backend features (sqlite, postgres, mongodb, s3, elasticsearch), filtered to the modules the pending fixes touch (among them bulk_submit, error::, composite::, backends::s3): 1081 passed.
  • cargo test -p helios-persistence --test postgres_tests bulk_submit against a PostgreSQL container: 65 passed, 1 ignored. That includes the two updated savepoint tests.
  • I did not run the MongoDB integration suite, the whole persistence library suite or clippy locally; CI runs them.

These ran on a branch that also carried other pending fixes, so the suites were verified in combination, not on this branch alone.

Per-entry receipts and file error artifacts on PostgreSQL, SQLite,
MongoDB and composite storage carried the Display text of the internal
StorageError. They now use StorageError::client_text(): a server-side
fault is a fixed sentence with the detail in the log, and errors about
the submitted content keep their text and issue code.

client_text() also withholds the log-only reason of the Transient,
CommitOutcomeUnknown, RolledBack and TooLargeForCache transaction
errors, which the MongoDB ingest path can produce.

Closes #3053
@claude

claude Bot commented Dec 2, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

This branch has not been deployed

No deployments
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.

Bulk-submit error receipts on PostgreSQL, SQLite, MongoDB and composite carry internal storage error text in diagnostics

1 participant