Fix runaway Convex demo dashboard reads - #72
Open
bryanlin850 wants to merge 2 commits into
Open
Conversation
Contributor
Greptile SummaryReplace reactive, scan-heavy dashboard queries with persisted demo summaries and explicitly refreshed snapshots.
Confidence Score: 5/5The PR appears safe to merge with no concrete correctness or security failures identified. The persisted demo summary is maintained by the sole demo seed and teardown mutation, existing memory-list callers retain equivalent behavior, and dashboard snapshot races and failures are handled with request guards and explicit retry controls. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Demo mode mutation] --> B[Delete existing demo rows]
B --> C{Enable demo mode?}
C -->|Yes| D[Seed demo rows]
C -->|No| E[Use zero counts]
D --> F[Persist demo count summary]
E --> F
F --> G[Persist enabled setting]
G --> H[Status reads two settings rows]
I[Dashboard mounts or user refreshes] --> J[Run one-shot metrics query]
J --> K[Render snapshot and timestamp]
Reviews (1): Last reviewed commit: "fix: normalize memory dashboard limits" | Re-trigger Greptile |
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
Why
The debug dashboard's reactive demo-status query repeatedly scanned operational tables after writes. On an active development deployment, this caused excessive Convex function calls and database reads even when the dashboard only needed a small status summary.
Validation
npm run typechecknpm test— 16 test files, 73 testsnpm run build:debugScope
Two commits and six files, all specific to the Convex demo/dashboard read-amplification fix. No fork-only application changes are included.