[v0.1.x-branch] Backport #1007: multi: Report empty round-join as no-op, not INTERNAL - #1009
Merged
Merged
Conversation
In this commit, we stop a refresh or leave that queued nothing from
failing its follow-on round join with a confusing INTERNAL error. An
`ark vtxos refresh --all` (or `leave --all`) with no live VTXOs, or any
selection that resolved to nothing, returns a clean queued no-op from
RefreshVTXOs -- but the CLI then auto-joined the next round, and
JoinNextRound failed with:
INTERNAL: join next round: failed to trigger round registration:
no pending round for event *round.IntentRequested
an error that named neither cause nor fix.
The round actor produced that condition as a bare fmt.Errorf, so no
caller could tell the benign "nothing was queued" case apart from a
genuine fault. We give it a typed ErrNoPendingRound sentinel, wrapped
with %w through TriggerRoundRegistration. JoinNextRound now maps it to a
clean JoinNextRoundResponse{Status: "nothing_to_join"} instead of
codes.Internal, and the CLI's auto-join prints "nothing queued to join"
rather than surfacing an error.
Found while manually testing #987.
(cherry picked from commit 266d260)
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.
Backport of #1007
In this PR, we fix a third bug found while manually testing #987 on the
arktest regtest harness: a refresh or leave that queued nothing still
auto-joins the next round, and that join fails with a confusing
INTERNALerror instead of a clean no-op.The bug
ark vtxos refresh --all(orleave --all) with no live VTXOs — or anyselection that resolves to nothing — correctly returns a queued no-op
from
RefreshVTXOs. But the CLI then auto-joins the next round, andJoinNextRoundfails:The command exits 1 with an error that names neither the cause nor the
fix, even though nothing actually went wrong — there was simply nothing
to join.
Observed on the live daemon:
refresh --all --yeswith an empty walletprints the
queuedno-op JSON, then theINTERNALabove; with thischange it prints
nothing queued to joinand exits 0.The fix
The round actor produced the "no pending round" condition as a bare
fmt.Errorf, so no caller could tell this benign "nothing was queued"case apart from a genuine internal fault. We give it a typed
ErrNoPendingRoundsentinel, wrapped with%wthroughTriggerRoundRegistration.JoinNextRoundnow maps it to a cleanJoinNextRoundResponse{Status: "nothing_to_join"}instead ofcodes.Internal, and the CLI's auto-join step printsnothing queued to joinrather than surfacing an error. An explicitark rounds joinwithnothing queued gets the same clean treatment.
Validation
roundtest: a server message with no pending round fails with atyped error (
errors.Is(..., ErrNoPendingRound)).cmd/waveclitests:maybeJoinNextRoundreportsnothing_to_joinas a no-op, and an ordinary join still prints the join notice.
roundandcmd/wavecli/waveclicommandspackages under-race.make fmt-changed-check,make lint-changed-local(0 issues),make commitmsg-lint,make build.--all --yesnowreports the no-op cleanly).
Found while manually testing #987.