-
Notifications
You must be signed in to change notification settings - Fork 715
fix: reset isPartialData state on error handling #8836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Testdino Test Results
|
f065579 to
2dd1b4e
Compare
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
Resets state.isPartialData to false across all error handlers to prevent stale partial-data UI indicators from persisting after query failures.
Changes
- Added
state.isPartialData = falsein 7 error handling paths:handleSearchResponseerror type handler (line 870)handleSearchResponseexception catch block (line 895)handleSearchErrorfunction (line 998)handleSearchClosefunction (line 977)getDataThroughWebSocketcatch block (line 1099)getDataThroughStreamingcatch block (line 1208)processApiErrorfunction (line 2087)
Context
The isPartialData flag controls a UI indicator showing when data is incomplete. Previously set to true on cancellations and partial responses (lines 350, 471, 886, 1182, 2550), it was not consistently cleared on errors, causing the partial-data icon to stick around even after failures.
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The changes are simple, focused, and follow existing patterns. Each addition of
state.isPartialData = falseis placed in error handling paths alongside existing state resets (loading = false,isOperationCancelled = false). The logic is sound: errors represent definitive completion states (not partial data), so the partial-data flag should be cleared. No complex logic changes or side effects introduced. - No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| web/src/composables/dashboard/usePanelDataLoader.ts | 5/5 | Added state.isPartialData = false resets across 7 error handling paths to prevent stale partial-data UI state after failures |
Sequence Diagram
sequenceDiagram
participant User
participant DataLoader as usePanelDataLoader
participant API as Query API
participant State as UI State
User->>DataLoader: Trigger data load
DataLoader->>API: Send query request
alt Query succeeds
API-->>DataLoader: Success response
DataLoader->>State: isPartialData = false
DataLoader->>State: loading = false
State-->>User: Show complete data
else Query fails (Error)
API-->>DataLoader: Error response
DataLoader->>State: isPartialData = false ✅
DataLoader->>State: loading = false
DataLoader->>State: Set error details
State-->>User: Show error (no stale partial icon)
else Query cancelled
User->>DataLoader: Cancel operation
DataLoader->>API: Cancel request
DataLoader->>State: isPartialData = true
DataLoader->>State: isOperationCancelled = true
State-->>User: Show partial data indicator
else Exception thrown
API-->>DataLoader: Exception
DataLoader->>State: isPartialData = false ✅
DataLoader->>State: loading = false
DataLoader->>State: Set error details
State-->>User: Show error (no stale partial icon)
end
1 file reviewed, no comments
2dd1b4e to
9bd6af9
Compare
PR Type
Bug fix
Description
Reset
isPartialDataon error pathsPrevent stale partial-data icon after failures
Align error handlers to clear partial state
Diagram Walkthrough
File Walkthrough
usePanelDataLoader.ts
Reset partial-data flag across all error pathsweb/src/composables/dashboard/usePanelDataLoader.ts
state.isPartialData = falsein multiple error branchesprocessApiErroralways resets partial-data state