feat: resilient WS client, wallet views, sqlite maintenance, error-registry fee/rent - #458
Open
Sendi0011 wants to merge 1 commit into
Open
feat: resilient WS client, wallet views, sqlite maintenance, error-registry fee/rent#458Sendi0011 wants to merge 1 commit into
Sendi0011 wants to merge 1 commit into
Conversation
|
@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! 🚀 |
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
chips (native XLM + token balances) with full i18n.
scheduled online backups with retention.
lifecycle with TTL-based rent accounting, per-agent live-entry caps, and a
deterministic expiry sweep.
seq-cursor resumption, gap detection with re-sync, and backoff.Changes
#372 Wallet views (
frontend)useWalletBalancenow returns a fullbalancesarray (all Horizon assettypes) alongside the backward-compatible native
balance.WalletPagerenders balance chips (native + token), with non-native tokensgrouped under a "Tokens" heading; address copy uses a secure-context
clipboard with
execCommandfallback and shows a success toast.WalletWizardcash-out/fund step formats balances to 7 decimals and renderstoken chips, plus a "once funded…" hint and testnet faucet link.
wallet.tokens.headinganda11y.balanceChiptoen/zhand keptfull parity. Updated
WalletPage/WalletWizardtests.#363 SQLite maintenance (
backend)src/services/dbMaintenance.ts:DbMaintenanceServiceruns a periodicpass across
payments/tasks/agents/jobsDBs doingwal_checkpoint(TRUNCATE),incremental
VACUUMabove a free-page ratio, and onlinebackup()snapshotswith retention pruning.
src/index.tsstartup/shutdown and exposed the following configknobs:
DB_MAINTENANCE_INTERVAL_MS,DB_MAINTENANCE_VACUUM_THRESHOLD,DB_BACKUP_DIR,DB_BACKUP_RETENTION_COUNT.#362 Error-registry fee/rent (
backend)src/db/errorRegistry.ts: anerrorstable with TTL-based rent(
expires_at), per-entryrentStroopsattributed to a maintenance account,submit/resolve/countLiveByAgent/capLiveEntries/sweepExpired.AgentDb.upsertError/resolveErrorandswitched
registry/sync.tserror handlers from log-only to persistence.src/services/errorRegistryMaintenance.tsruns the deterministic expirysweep and per-agent cap enforcement; wired into
src/index.tsand config(
ERROR_REGISTRY_MAINTENANCE_INTERVAL_MS,ERROR_REGISTRY_CAP_PER_AGENT).#371 WebSocket client resilience (
frontend)useTaskWebSocketnow sends the{ walletPublicKey }auth frame (opt-in),answers server
pingwithpong, tracks each event'sseq, persists aper-task resume cursor, and reconnects with
?lastEventId=Nso missedevents are replayed.
seqgaps trigger one re-sync via the cursor;4408(STALE) closesreset the backoff for prompt reconnect; intentional disconnects no longer
schedule a zombie reconnect.
seq?: numbertoDAGEventand optionalmaxReconnectAttempts/maxJitterMs(default 0 keeps the base backoff deterministic for tests).Verification & Testing
npm test(Backend/Frontend) — not run:node_modulesnot installed inthis 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
feat:)npm run build/
npm run lintand frontendnpm run buildto confirm (no deps here).docs/orREADME.mdif applicable — new envknobs are self-documenting in
src/config; happy to add to the operatorguide if requested.