Repository navigation
Time out the app and testnet pages' RPC reads after 20 seconds - #325
Merged
Merged
Conversation
A node that accepted the connection and never answered left /app and /testnet waiting with no message (finding 22 of the 15 November performance review). Each page now aborts a read that has not finished in 20 s, body included, as the epochs page does, and reports it where it reports any failed read: the log on /app, the card on /testnet. The startup reads in app.js stay as they are. symbol() and decimals() are read from the token address that svr() returns when the fee registry is live, so the four cannot go in one batch. Both scripts are bumped to ?v=timeout1. One regression test per page fails on the old code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…44 [skip ci] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
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.
The site's part of the minor findings (22) from the 15 November performance review.
22. Two site pages read the RPC with no timeout (
app.js,testnet.js)A node that accepted the connection and never answered left the app and testnet pages waiting with no message. Both now abort a read that has not finished in 20 s, body included, the limit the epochs page already uses, and show it where each page already reports a failed read ("RPC read failed: ...", "lookup failed: ...", "read failed: the RPC did not answer within 20 seconds").
app.jsandtestnet.jsare at?v=timeout1on the only page that loads each.Not done: batching
app.js's startup reads.symbol()anddecimals()read the token addresssvr()returns, so they cannot go in one batch with it; with the fee registry off, as on this deploy, only those two go out at load.Tests
oracle/site-app.test.jsandoracle/site-pages.test.js: 13 pass. Each new test fails on main: the app's read at load never ends, and the testnet card stays at "reading chain". Served locally under the production CSP: /testnet filled all five steps from the live RPC, /app's startup reads and a lookup completed, with no console errors. This adds 2 oracle tests; the documented count is reconciled when the PRs that change it are merged.🤖 Generated with Claude Code