Repository navigation
fix: Migrate server ws to xrpl.js Client - #1382
Merged
Merged
Conversation
Client
kuan121
reviewed
Oct 22, 2026
kuan121
approved these changes
Oct 23, 2026
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.
High Level Overview of Change
Replaces
xrpl-clientwithxrpl.jsin the backend (server/lib/rippled.js) and adds recovery for a stalled ledger stream. This fixes pods silently serving frozen ledger metrics (DGE-5078).xrplClientand re-subscribe to the ledger stream on every (re)connect.VITE_RIPPLED_HOST, if more than one is configured./api/v1/metricsreturns{}(shown as--) when metrics are older than 60s, instead of stale values.getAccountInfo/getBalances/getOffers. The server doesn't call them; the frontend has its own copies.xrplfromdevDependenciestodependencies. No version change.log.infoContext of Change
A staging pod (
h46tx) stopped receiving ledgers on Oct 18 and served frozen metrics for days; prod had the same issue in Aug 2025. Root cause:xrpl-client's inactivity timer calledclose().websocketpackage only half-closes the socket (socket.end(), neverdestroy()), and the peer never sent its FIN.closeevent never fired, andxrpl-client(which only reconnects onclose) never reconnected.xrpl.jsusesws, which destroys the socket after its close timeout, and pings every 20s. The watchdog also covers cases a ping can't detect (lost subscription, unsynced node, failed first connect). The frontend still usesxrpl-clientand isn't affected: browsers use the nativeWebSocket, which doesn't have this bug.Type of Change
Before / After
online: false, no reconnect) and serving its last metrics until a redeploy./api/v1/metricsreturns{}(shown as--) while the data is stale.Rippled client:now logsendpoint,connected,lastLedgerIndexandsecSinceLastLedger.No ledger from … reconnecting,Connected to …,Disconnected from ….Test Plan