mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6207] [MERGED] fix(nodes): report probe heartbeat persistence failures #6169
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6207
Author: @n0ctal
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/13/2026
Merged by: @MHSanaei
Base:
main← Head:codex/upstream-node-probe-persist-error📝 Commits (2)
22d3eacfix(nodes): report probe heartbeat persistence failures62db331Merge branch 'main' into codex/upstream-node-probe-persist-error📊 Changes
2 files changed (+53 additions, -1 deletions)
View changed files
📝
internal/web/controller/node.go(+4 -1)📝
internal/web/controller/node_credentials_writeonly_test.go(+49 -0)📄 Description
Summary
The manual node probe endpoint discards the error from
UpdateHeartbeat, so the panel reports a successful probe even when the result was never stored. This propagates the error to the caller.Why
probecontacts the node, builds a status patch, persists it, and returns the patch to the UI. The persistence result was dropped with_ =. When the write fails, the operator sees a green result and a node row that still shows the previous state; the next background heartbeat then reports something different, and the disagreement looks like flapping rather than a failed write.The background heartbeat path already checks this same error. The controller was the one branch that did not, which is the usual sign of an oversight rather than a decision.
Scope
internal/web/controller/node.go:probereturns the persistence failure throughjsonMsginstead of ignoring it.The i18n key reused here,
pages.nodes.toasts.test, is the one the surrounding handlers already use for this operation and is translated in every locale.Validation
TestNodeControllerProbeReportsHeartbeatPersistenceFailuredrives the real HTTP handler with a fake remote and an injected persistence failure.internal/web/controller/node.goreverted, the test fails withprobe reported success despite heartbeat persistence failure, so it guards the defect rather than the signature.go build ./internal/...,go vet, package tests,golangci-lint,staticcheck -checks=U1000(host andGOOS=linux),make gen-check: all clean.Risk
This changes what the endpoint returns in one case: a probe that reached the node but could not be recorded is now an error response rather than a success carrying the live result. That is the intended trade — the operator should not be told a node was checked when the check was not durable. Callers that only read the success flag will now surface a failure where they previously showed stale data.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.