Skip to content

fix(speedtest): clear the last speed when a speed test starts - #10449

Open
L4XB wants to merge 1 commit into
2dust:masterfrom
L4XB:fix/speedtest-clear-old-speed
Open

L4XB wants to merge 1 commit into
2dust:masterfrom
L4XB:fix/speedtest-clear-old-speed

Conversation

@L4XB

@L4XB L4XB commented Oct 23, 2026

Copy link
Copy Markdown

Fixes #10405

When a node's speed test is skipped because its delay test failed, or its download fails, the list shows the skip or error text, but the node keeps the speed it got in an earlier run. DoSpeedTest only stores a speed above zero, and nothing resets the old value. The list is rebuilt from the stored values, so after clicking the Speed column (or any refresh) the old speed comes back and the node sorts as if it had been measured. That is the case in #10405: test once with a working connection, test again offline, then sort by speed.

The fix clears the stored speed in SetTestResultAsync when a speed test or a mixed test starts, where the display is already reset to "testing". Measured speeds are stored as before. A node without a result now shows its skip or error message after a rebuild (SpeedVal falls back to the message when the speed is 0) and sorts to the end with the other untested nodes. Delay results are not touched.

Tests: SpeedtestServiceResultTests stores an old speed, starts a speed test, a mixed test and a real-ping test through SetTestResultAsync, and checks that only the two speed tests clear it. Without the fix the speed and mixed cases fail. dotnet test ServiceLib.Tests: 139 passed on macOS arm64 with .NET 10.0.402.

A speed test only stored a speed above zero, so a node that was skipped
because its delay test failed, or whose download failed, kept the speed
of the previous run. The list showed the skip or error text until it was
sorted or refreshed; then the old speed came back and the node sorted as
if it had been measured. Clear the stored speed when a speed or mixed
test starts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: v7.25.6跳过测试后,如果重排序,那个跳过条目的“速度”栏显示的依然是上次测速的速度

1 participant