Speed up dashboard reads, task counts, and live refreshes - #2611
Conversation
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationReady to merge within the reviewed scope. The PR addresses API responsiveness through smaller completion queries and a dedicated read-only worker, while replacing repeated browser reads with authorized snapshots. ✅ Bounded worker execution — Concurrent identical requests share an in-flight promise, distinct requests are capped, and worker failure rejects outstanding reads without retaining cached results. ✅ Authorized snapshot delivery — Usage snapshots enforce the HTTP endpoint’s demo-or- ✅ Recovery and ordering — Pushed system health invalidates older HTTP responses; subscription bootstrap has a bounded fallback; disconnected polling and reconnect recovery remain supported. The supplied current-head checks show 23 passed, none failed or pending, and 23 neutral/skipped. This assessment uses static tracing of the supplied code; no commands or tests were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Make responsiveness testing deterministicIn S2: 🟢 Update usage event documentationThe unchanged comment in ScoreThe implementation directly addresses the objective, includes focused regression coverage, and has no verified merge blockers in the supplied code. Current-head checks are successful. Score: 9/10 🤖 Review Details
🤖 Review by ProPR |
|
CI failed: Full Test Suite Shard 1/4 Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 3a17177 Summary of ChangesFixed outdated Socket.IO mocks in the failing activity-delivery test and a related usage test. Added assertions for snapshot delivery, deduplication, and shutdown. Validation: all 13 tests across three relevant files passed; targeted lint and diff checks passed. The Node.js deprecation warning was unrelated. No visual changes or previews. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
CI failed: Full Test Suite Shard 3/4 Please investigate and fix this CI failure.
Failure evidence
|
|
CI failed: Run Full Test Suite Please investigate and fix this CI failure.
Failure evidence
|
Full Test Suite ResultsValidation failed during: Test shard (shard 1), Test shard (shard 3).
View shard 1/4 outputView shard 3/4 outputDetails truncated; see the uploaded artifacts for complete failure rows and logs. |
…very test and a related usage test. Added assertions for snapshot delivery, deduplication, and shutdown. Fixed outdated Socket.IO mocks in the failing activity-delivery test and a related usage test. Added assertions for snapshot delivery, deduplication, and shutdown. Validation: all 13 tests across three relevant files passed; targeted lint and diff checks passed. The Node.js deprecation warning was unrelated. No visual changes or previews. PR: #2611 Comment by: @propr-dev[bot] (ID: 5887919044) Model: gpt-6-astra
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot], @github-actions[bot] Analysis SummaryThe reported failures are already fixed by branch commit CI logs confirm outdated Socket.IO mocks lacked Verified locally: all 20 tests across four relevant files passed, plus targeted lint. No further changes or visual previews were needed. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Dashboard completion queries blocked the API event loop for several seconds, delaying unrelated authenticated reads. This PR reduces that SQL work and moves the remaining completion projection into a dedicated read-only worker. It also reduces task-count work and replaces repeated status/usage HTTP refreshes with authorized WebSocket snapshots.
Changes:
/index.htmlalias, and share concurrent service-worker registration attempts.Verified live results
Twelve implementation commits through
e5eb86905are deployed onui.gitfix.dev/api.gitfix.dev. Staging source revision60e879582contains its prior base plus these twelve changes; unrelated main-branch changes were not included. Original local Compose files are unchanged.A separate three-minute authenticated dashboard trace measured the polling fix:
/api/status/api/config/agent-tank/usage/api/auth/userThe updated browser made no API requests after its first ten seconds during that trace, while consuming four usage snapshots and one health snapshot (plus legacy invalidations) without page errors. The captures contain different task activity, so the total request reduction (82 to 35) is not presented as a controlled throughput comparison. Derived task/dashboard projections still reconcile on relevant activity and on their five-minute missed-event safety interval; this is not a claim that all HTTP traffic is eliminated.
Standalone task-list reads measured 202 → 181 ms median. Standalone task search remained approximately 0.25 seconds (235 → 259 ms across the separate live runs); no isolated network-speed improvement is claimed for that endpoint. The request-thread fix prevents completion projections from adding seconds of queueing to those reads.
On the fixed staging snapshot, outcomes title search improved from 4,784 to 974 ms, no-match search from 4,008 to 438 ms, and warm all-task SQL counts from about 36 to 6.6 ms. Full projection/list objects matched the original implementation. Worker reads preserve result parity and subsequent-write visibility; a foreground probe during concurrent completion reads improved from 1,241 to 11 ms locally.
Startup follow-up: Live startup verification: fresh load and idle reload each made 22 API requests to 22 distinct URLs, with no duplicate API reads or page errors. Opening a second tab caused zero API reads in the original tab. The service worker activated with propr-shell-v2; no /index.html or /index alias was fetched and reload did not repeat asset precaching. A task completion during a separate reload correctly refreshed affected projections. After a forced 35-second outage, the socket rejoined activity and all 26 recovery reads returned 200, with no page errors.
Validation and rollout
d7c72e72abefore rollout.Deployment was coordinated across Node services for the index migration, then API-only for the read-worker follow-up and API/UI-only for the push follow-up (no new schema changes). Staging source/default image tags match the deployment. Image mappings, current/rollback Compose overrides, and operating instructions are retained in
/root/gitfix-deployments/read-perf-20260929. A consistent predeployment database backup is retained; routine rollback uses image/index rollback rather than replacing newer user data.packages/api/PERFORMANCE.mdandscripts/benchmark-dashboard-outcomes.tsdocument the investigation and snapshot reproduction (--workeralso reports foreground timer responsiveness).