Skip to content

Raw statement documents, optional request timeout, no account data in error logs - #43

Closed
agiledivider wants to merge 1 commit into
robocode13:mainfrom
agiledivider:feat/raw-statements-timeout-quiet-errors
Closed

agiledivider wants to merge 1 commit into
robocode13:mainfrom
agiledivider:feat/raw-statements-timeout-quiet-errors

Conversation

@agiledivider

Copy link
Copy Markdown

Three small changes from using lib-fints in a club-management app:

  • StatementResponse.rawDocuments: the CAMT documents (one per booking day) or the MT940 stream exactly as the bank sent them, so callers can run their own parser, e.g. to treat downloaded and uploaded statements alike. All CAMT documents are decoded before parsing, so they are all present even when the built-in parser fails on one.
  • HttpClient.timeoutMs: when set, every request gets an AbortSignal.timeout, so a bank that doesn't answer can't hang a dialog. It is unset by default, so nothing changes for existing callers.
  • When a response can't be decoded, its content (which holds balances, bookings and names) is printed only in debug mode.

Tests: src/tests/rawStatementsAndHttpClient.test.ts. Existing tests and the build (tsc, Biome) pass.

…ata in error logs

- StatementResponse.rawDocuments: the CAMT documents (one per booking
  day) or the MT940 stream exactly as the bank sent them, so callers can
  run their own parser. All CAMT documents are decoded before parsing, so
  they are all there even when the built-in parser fails on one.
- HttpClient.timeoutMs: when set, every request gets an
  AbortSignal.timeout, so a bank that doesn't answer can't hang a dialog.
  Unset by default, so nothing changes for existing callers.
- An undecodable response is printed only in debug mode: it holds
  account data (balances, bookings, names).
@agiledivider

Copy link
Copy Markdown
Author

Split into three independent PRs, one per change: #44, #45, #46

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