Skip to content

fix(data-api): widen accounts-summary route's statement_timeout to 10s#8155

Merged
JSONbored merged 1 commit into
mainfrom
fix/account-summary-statement-timeout
Jul 25, 2026
Merged

fix(data-api): widen accounts-summary route's statement_timeout to 10s#8155
JSONbored merged 1 commit into
mainfrom
fix/account-summary-statement-timeout

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Confirmed live in production (pg_stat_activity + Postgres container logs) that GET /api/v1/accounts/:ss58 was still tripping canceling statement due to statement timeout after fix(postgres): correct account_events index shape + safety-scan wording #8154's index fix — the query plan is correct now (no Sort, both new indexes used), but the route's two sequential hotkey/coldkey scans across account_events' 87 chunks still occasionally exceed the dispatcher's shared 3000ms default under real concurrent load.
  • The sibling /api/v1/accounts/:ss58/events route hit this exact class of problem first and already carries its own SET LOCAL statement_timeout = '10000ms' override rather than raising the global default for every other, lighter route. Ports that same override to the summary route.

Test plan

  • npx vitest run tests/data-api.test.ts — 543/543 pass (4 tests updated for the new SET LOCAL call in the mock queue)
  • npx tsc --noEmit — clean (pre-existing unrelated codegen errors only)
  • npx tsx scripts/scan-public-safety.ts — passed
  • npx prettier --check — clean

Confirmed live: even with the ORDER BY/index fix (#8154), this route's
two hotkey/coldkey scans still tripped the shared 3000ms default under
real concurrent load. The sibling /accounts/:ss58/events route hit this
same class of problem first and already widens its own budget -- same
fix, ported here.
@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 25, 2026
@JSONbored
JSONbored merged commit 8c4703d into main Jul 25, 2026
6 of 8 checks passed
@JSONbored
JSONbored deleted the fix/account-summary-statement-timeout branch July 25, 2026 15:12
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.82%. Comparing base (88a3cf9) to head (67be041).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8155   +/-   ##
=======================================
  Coverage   97.82%   97.82%           
=======================================
  Files         415      415           
  Lines       28892    28893    +1     
  Branches    10850    10850           
=======================================
+ Hits        28264    28265    +1     
  Misses        141      141           
  Partials      487      487           
Files with missing lines Coverage Δ
workers/data-api.ts 98.00% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant