fix(explorer): gate temporal requests on graph load - #1003
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by Qodofix(explorer): gate temporal API requests on successful graph load
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
There was a problem hiding this comment.
Pull request overview
This pull request prevents GraphWorkspace from issuing temporal API requests (/api/temporal/bounds and /api/temporal/snapshot) until the initial graph load has successfully produced a graph summary, avoiding premature requests when the backend is unavailable.
Changes:
- Introduces explicit predicate helpers to decide when temporal bounds and snapshot requests are allowed.
- Gates temporal bounds and snapshot effects in
GraphWorkspaceon a successful graph summary (while still allowing empty graphs withnodeCount: 0). - Adds focused unit tests for the temporal lifecycle gating predicates and wires them into the existing graph workspace test script.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| explorer/tests/temporalLifecycle.test.ts | Adds unit tests validating the new temporal request gating rules. |
| explorer/src/workspaces/GraphWorkspace/temporalLifecyclePredicates.ts | Introduces reusable predicates that encode when temporal bounds/snapshot requests may run. |
| explorer/src/workspaces/GraphWorkspace/GraphWorkspace.tsx | Applies the new gating predicates to the temporal bounds and snapshot effects. |
| explorer/package.json | Extends the graph workspace test script to include the new temporal lifecycle test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ZohaibHassan16
left a comment
There was a problem hiding this comment.
Thank you for raising the PR. Tested and confirmed. LGTM.
Addresses #982.
Summary
Prevents temporal API requests from running before the initial graph load has succeeded.
With the backend unavailable,
GraphWorkspacepreviously still requested:/api/temporal/boundson mount/api/temporal/snapshotonce the timeline initialized and graph loading failedBoth requests are now gated on a successful graph summary. Empty graphs (
nodeCount: 0) still count as a successful load.Investigation
I reproduced the backend-down path through the real Vite proxy on both current
mainand pre-#980.In both cases I observed:
/api/graph/nodes: 1 request/api/graph/edges: 0 requests/api/temporal/bounds: 1 premature request/api/temporal/snapshot: 1 premature requestI could not reproduce an autonomous repeated
/api/graph/nodesloop during the idle period, so this patch does not change the existing TanStack Query configuration.After the fix, with the backend unavailable:
/api/graph/nodes: 1 request/api/temporal/bounds: 0 requests/api/temporal/snapshot: 0 requestsTesting
npm --prefix explorer run test:graph-workspacenpm --prefix explorer run test:graph-storenpm --prefix explorer run test:plugin-registrynpm --prefix explorer run buildgit diff --check upstream/main...HEADAlso verified the runtime behavior with: