Repository navigation
a perp table that cannot load says so instead of vanishing - #2719
Merged
Merged
Conversation
Found by checking the deployed page after #2718 rather than the JSON: /api/capital served all 25 perp venues while the rendered /capital had the prediction-market table and no perp table at all. The API route is per-request and the page is ISR on a one hour window, so one render that missed the perp venue cohort snapshot cached a page with the table silently gone, for an hour, with nothing saying why. That is the defect this page spent the week removing, one level up: a missing table reads the same way a missing cell did. The section now keeps its heading and says which source did not answer, where the last measurements are (the perps hub and bench 271) and that /api/capital is read per request rather than cached with the page. It still substitutes nothing. The only other open-interest reading available here is DefiLlama's overview, which is a different measurement and is what #2718 moved off; filling the gap with it would undo that work and hide the outage behind plausible numbers. `perpVenueCohortLive` on the hub carries the state so the Markdown view and /api/capital say the same thing as the HTML.
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.
Found by checking the deployed page after #2718 rather than trusting the JSON.
The symptom
On staging after #2718 merged,
/api/capitalserved all 25 perp venues while the rendered/capitalhad the prediction-market table and no perp table at all. Three consecutive API reads returned 25 rows, so the source is reliably up.The cause
/api/capitalisforce-dynamic; the page is ISR onrevalidate = 3600. One render missed the perp venue cohort snapshot,hub.perpOicame back empty, thehub.perpOi.length > 0guard dropped the table, and that HTML was cached for an hour with nothing saying why.This is the defect this page spent the week removing, one level up: a missing table reads exactly the way a missing cell did.
The fix
The section keeps its heading and renders a line in the table's place naming the source that did not answer, where the last measurements are (
/perpsand bench 271), and that/api/capitalis read per request rather than cached with the page.perpVenueCohortLiveon the hub carries the state so the Markdown view and the JSON agree with the HTML.It still substitutes nothing. The only other open-interest reading available here is DeFiLlama's overview, which is a different measurement and is precisely what #2718 moved off. Filling the gap with it would undo that PR and hide an outage behind plausible numbers.
Verified locally, where the cohort snapshot is genuinely unreachable, so it is the exact failure case: the notice renders where the table would be, the section heading and the prediction-market table are unaffected.
pnpm validate240 specs,pnpm typecheck, eslint clean, 367 tests pass.