Skip to content

fix(account): return false in accountExists only on Horizon 404 (#29) - #35

Open
jeffrey-graham wants to merge 1 commit into
HyperDevTools:mainfrom
jeffrey-graham:jeffrey-graham-patch-1
Open

jeffrey-graham wants to merge 1 commit into
HyperDevTools:mainfrom
jeffrey-graham:jeffrey-graham-patch-1

Conversation

@jeffrey-graham

@jeffrey-graham jeffrey-graham commented Nov 8, 2026 •

Copy link
Copy Markdown

Closes #29

Updates AccountManager.accountExists and AccountManager.loadAccount (src/core/account.ts) so accountExists returns false only for confirmed Horizon not-found (404) responses instead of masking transport or server failures as nonexistent accounts:

  • Confirmed 404 -> false (AccountNotFoundError): Maps HTTP 404, NotFoundError, and non-DNS 404 error messages to AccountNotFoundError, while explicitly excluding DNS resolution messages (ENOTFOUND, host not found, server not found) so DNS outages never masquerade as missing accounts.
  • Timeout & server errors surfaced (NetworkTimeoutError / NetworkConnectionError): Maps socket/gateway timeouts (ETIMEDOUT, ECONNABORTED, TimeoutError, HTTP 408 / 504) to NetworkTimeoutError and connection/DNS/Horizon 5xx errors (ECONNREFUSED, ENOTFOUND, ECONNRESET, EAI_AGAIN, ENETUNREACH, status >= 500) to NetworkConnectionError without adding implicit retries.
  • Unit tests (src/__tests__/account.test.ts): Covers existing accounts (true), confirmed 404 responses (false), timeouts (NetworkTimeoutError), HTTP 504 gateway timeouts (NetworkTimeoutError), ENOTFOUND / DNS host-not-found (NetworkConnectionError), and Horizon 503 responses (NetworkConnectionError).

Local Verification

  • npx prettier --check "src/**/*.ts" -> all matched files formatted cleanly
  • npm run lint -> 0 warnings, 0 errors
  • npm test -- --coverage --runInBand -> 7 suites passed (77 / 77 tests, 93.52% statement coverage)
  • npm run build && npx tsc --noEmit -> 0 errors
  • npm audit --omit=dev --audit-level=moderate -> 0 vulnerabilities (GitHub Actions CI awaiting maintainer approval)

@jeffrey-graham jeffrey-graham changed the title fix(account): return false in accountExists only for confirmed 404 re… fix(account): return false in accountExists only on Horizon 404 (#29) Nov 12, 2026

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.

Return false only for confirmed missing accounts

1 participant