fix: use node current status as fallback instead of hardcoded UNKNOWN#102
Open
TerrifiedBug wants to merge 3 commits intomainfrom
Open
fix: use node current status as fallback instead of hardcoded UNKNOWN#102TerrifiedBug wants to merge 3 commits intomainfrom
TerrifiedBug wants to merge 3 commits intomainfrom
Conversation
When a node has no status event history within the selected range, the timeline and uptime router now fall back to the node's actual current status from the DB rather than always showing "UNKNOWN". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryUses the node's current DB status as a fallback instead of hardcoding
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant ST as StatusTimeline
participant EL as EventLog
participant tRPC as fleet.getStatusTimeline
participant DB as PostgreSQL
ST->>tRPC: queryOptions({ nodeId, range })
EL->>tRPC: queryOptions({ nodeId, range })
tRPC->>DB: Promise.all([findMany events, findUnique node])
DB-->>tRPC: [events[], node]
tRPC-->>ST: { events, nodeStatus }
tRPC-->>EL: { events, nodeStatus }
Note over ST: ✅ Destructures data.events & data.nodeStatus
Note over EL: ❌ Treats entire response as events array
|
getStatusTimeline now returns { events, nodeStatus } instead of a plain
array. EventLog was still treating data as an array, causing it to always
render empty. Destructure data.events to restore correct behaviour.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collapses three sequential DB round-trips in getUptime into a single Promise.all, reducing latency when loading node health cards. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
getStatusTimelinerouter now returns{ events, nodeStatus }— fetches the node's current DB status in parallel with eventsgetUptimerouter falls back tonodeForStatus?.statusbefore"UNKNOWN"when no prior event existsStatusTimelinecomponent usesdata.nodeStatusas the segment status when there are no events in range, instead of hardcoding"UNKNOWN"Test plan
🤖 Generated with Claude Code