fix(walletapi): configurable RPC call timeout + connectivity hardening - #78
Open
DHEBP wants to merge 5 commits into
Open
fix(walletapi): configurable RPC call timeout + connectivity hardening#78DHEBP wants to merge 5 commits into
DHEBP wants to merge 5 commits into
Conversation
- move connectionMu to shared daemon_communication.go (was only defined in the !wasm build, breaking GOOS=js builds of the shared loop file) - make invalidateRPCClient platform-specific so the websocket close call matches the connector API (gorilla: Close(); coder/websocket: Close(status, reason))
…ort sync failure A failed background token refresh (SyncHistoryAsync) was aborting the whole RPC response instead of falling through to already-cached data, turning a transient/best-effort refresh into a hard failure for callers.
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
Reconciles moralpriest's RPC connectivity hardening (DHEBP/derohe#22) onto
community-dev. Adds a configurable timeout to daemon RPC calls (Client.Callcurrently has none — calls can hang indefinitely on a half-open connection), plus native sync status/progress tracking and a wasm build fix.Also fixes
GetTransfersaborting its whole response when a best-effort background token refresh fails — now logs and falls back to cached data instead.Included prerequisite: PR21
Builds on #21 (
4aecb1a, the 10s RPC timeout), merged toexperimentalin July but never tocommunity-dev— confirmed not an ancestor, code never appears there under any hash, no commits from the author touching this file. Riding along inside this PR rather than opening separately first.Limitation: 10s timeout is hardcoded
SetRPCCallTimeout()has zero call sites — every daemon RPC, including XSWD dApp calls, is capped at 10s with no override. Not measured against a slow/degraded daemon; reasoned risk. Open to a configurable override landing alongside or as a fast-follow.Limitation: wallet close doesn't wait on in-flight sync
Abrupt close can leave stale/dropped transfer-history entries, self-healing on next sync — no fund-safety or corruption risk. Left as-is to avoid reintroducing an uncancellable-close hang.
Scope note
Original PR22 also restored a per-SCID refresh loop needed only by a downstream fork (HOLOGRAM).
community-devalready has an equivalent loop since 2022, so that part is dropped as redundant here.Verification
go build ./...clean,go test ./walletapipassesblockchain/,p2p/,cryptography/,dvm/,block/,transaction/, orconfig/consensus constantswalletapi/, no unrelated carry-over