Skip to content

feat: resilient WS client, wallet views, sqlite maintenance, error-registry fee/rent - #458

Open
Sendi0011 wants to merge 1 commit into
Epta-Node:mainfrom
Sendi0011:feat/wallet-views-balance-chips
Open

feat: resilient WS client, wallet views, sqlite maintenance, error-registry fee/rent#458
Sendi0011 wants to merge 1 commit into
Epta-Node:mainfrom
Sendi0011:feat/wallet-views-balance-chips

Conversation

@Sendi0011

@Sendi0011 Sendi0011 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #372
Closes #363
Closes #362
Closes #371

This PR ships four scoped improvements together, tackling resilient task
streaming, wallet UX, on-disk data integrity, and sustainable error-record
accounting across the full stack.

Changes

#372 Wallet views (frontend)

  • useWalletBalance now returns a full balances array (all Horizon asset
    types) alongside the backward-compatible native balance.
  • WalletPage renders balance chips (native + token), with non-native tokens
    grouped under a "Tokens" heading; address copy uses a secure-context
    clipboard with execCommand fallback and shows a success toast.
  • WalletWizard cash-out/fund step formats balances to 7 decimals and renders
    token chips, plus a "once funded…" hint and testnet faucet link.
  • Added wallet.tokens.heading and a11y.balanceChip to en/zh and kept
    full parity. Updated WalletPage/WalletWizard tests.

#363 SQLite maintenance (backend)

  • New src/services/dbMaintenance.ts: DbMaintenanceService runs a periodic
    pass across payments/tasks/agents/jobs DBs doing wal_checkpoint(TRUNCATE),
    incremental VACUUM above a free-page ratio, and online backup() snapshots
    with retention pruning.
  • Wired into src/index.ts startup/shutdown and exposed the following config
    knobs: DB_MAINTENANCE_INTERVAL_MS, DB_MAINTENANCE_VACUUM_THRESHOLD,
    DB_BACKUP_DIR, DB_BACKUP_RETENTION_COUNT.

#362 Error-registry fee/rent (backend)

  • New src/db/errorRegistry.ts: an errors table with TTL-based rent
    (expires_at), per-entry rentStroops attributed to a maintenance account,
    submit/resolve/countLiveByAgent/capLiveEntries/sweepExpired.
  • Implemented the previously stubbed AgentDb.upsertError/resolveError and
    switched registry/sync.ts error handlers from log-only to persistence.
  • New src/services/errorRegistryMaintenance.ts runs the deterministic expiry
    sweep and per-agent cap enforcement; wired into src/index.ts and config
    (ERROR_REGISTRY_MAINTENANCE_INTERVAL_MS, ERROR_REGISTRY_CAP_PER_AGENT).

#371 WebSocket client resilience (frontend)

  • useTaskWebSocket now sends the { walletPublicKey } auth frame (opt-in),
    answers server ping with pong, tracks each event's seq, persists a
    per-task resume cursor, and reconnects with ?lastEventId=N so missed
    events are replayed.
  • Detected seq gaps trigger one re-sync via the cursor; 4408 (STALE) closes
    reset the backoff for prompt reconnect; intentional disconnects no longer
    schedule a zombie reconnect.
  • Added seq?: number to DAGEvent and optional maxReconnectAttempts /
    maxJitterMs (default 0 keeps the base backoff deterministic for tests).

Verification & Testing

  • npm test (Backend/Frontend) — not run: node_modules not installed in
    this environment and the enclosing constraint forbids installing deps /
    running tests. Changes were reviewed for type consistency against the
    existing code and kept backward-compatible with the existing test
    expectations (deterministic backoff delays and attempt limits preserved).
  • cargo test (Smart Contracts) — N/A: no smart-contract source changes.
  • cargo fmt --check && cargo clippy (Contract Linting) — N/A.

Contributor Checklist

  • PR title follows Conventional Commits (feat:)
  • All CI checks pass locally — pending; please run backend npm run build
    / npm run lint and frontend npm run build to confirm (no deps here).
  • Documentation updated in docs/ or README.md if applicable — new env
    knobs are self-documenting in src/config; happy to add to the operator
    guide if requested.
  • No secrets or credentials committed

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Sendi0011 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Sendi0011 is attempting to deploy a commit to the Jaja's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant