Skip to content

multi: Report empty round-join as no-op, not INTERNAL - #1007

Merged
Roasbeef merged 1 commit into
mainfrom
fix/join-next-round-empty-noop
Jul 20, 2026
Merged

multi: Report empty round-join as no-op, not INTERNAL#1007
Roasbeef merged 1 commit into
mainfrom
fix/join-next-round-empty-noop

Conversation

@Roasbeef

Copy link
Copy Markdown
Member

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.
@Roasbeef Roasbeef added the backport-v0.1.x-branch Backport this merged PR to v0.1.x-branch label Jul 20, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request gracefully handles the case where an auto-join is triggered but there are no pending rounds or queued VTXOs. It introduces a typed ErrNoPendingRound error, which the RPC server intercepts to return a benign nothing_to_join status instead of an internal error. The CLI is updated to handle this status and print a friendly message. Comprehensive unit tests have been added to verify these changes. I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Roasbeef
Roasbeef merged commit 7f4f29e into main Jul 20, 2026
21 checks passed
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for v0.1.x-branch:

Roasbeef added a commit that referenced this pull request Jul 20, 2026
…ranch

[v0.1.x-branch] Backport #1007: multi: Report empty round-join as no-op, not INTERNAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v0.1.x-branch Backport this merged PR to v0.1.x-branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant