Skip to content

[v0.1.x-branch] Backport #1007: multi: Report empty round-join as no-op, not INTERNAL - #1009

Merged
Roasbeef merged 1 commit into
v0.1.x-branchfrom
backport-1007-to-v0.1.x-branch
Jul 20, 2026
Merged

[v0.1.x-branch] Backport #1007: multi: Report empty round-join as no-op, not INTERNAL#1009
Roasbeef merged 1 commit into
v0.1.x-branchfrom
backport-1007-to-v0.1.x-branch

Conversation

@github-actions

Copy link
Copy Markdown

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
INTERNAL error instead of a clean no-op.

The bug

ark vtxos refresh --all (or leave --all) with no live VTXOs — or any
selection that resolves to nothing — correctly returns a queued no-op
from RefreshVTXOs. But the CLI then auto-joins the next round, and
JoinNextRound fails:

INTERNAL: join next round: failed to trigger round registration:
no pending round for event *round.IntentRequested

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 --yes with an empty wallet
prints the queued no-op JSON, then the INTERNAL above; with this
change it prints nothing queued to join and 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
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 step prints nothing queued to join rather than surfacing an error. An explicit ark rounds join with
nothing queued gets the same clean treatment.

Validation

  • New round test: a server message with no pending round fails with a
    typed error (errors.Is(..., ErrNoPendingRound)).
  • New cmd/wavecli tests: maybeJoinNextRound reports nothing_to_join
    as a no-op, and an ordinary join still prints the join notice.
  • Full round and cmd/wavecli/waveclicommands packages under -race.
  • make fmt-changed-check, make lint-changed-local (0 issues),
    make commitmsg-lint, make build.
  • Live re-verification on the arktest harness (empty --all --yes now
    reports the no-op cleanly).

Found while manually testing #987.

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)
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.

1 participant