Skip to content

Check shielded-operation admission before a tree rebuild cancels sync #6452

Backlog

Description

@lklimek

TL;DR: When a wallet app asks for a shielded-tree rebuild while another shielded operation is running, the rebuild is refused, but a manual sync pass it already stopped ends with an empty result and no completion event.

User story

As a wallet app developer, I want a refused rebuild to leave a running manual sync untouched, to avoid showing users a sync that silently did nothing.

Scenario

Base flow

The app starts a manual shielded sync, and while it runs the user starts a shielded operation and then asks for a tree rebuild.

Actual behavior

The rebuild first stops the sync pass in flight, then tries to take exclusive operation admission. Admission is refused with ShieldedOperationInProgress; nothing is reset and background sync restarts, but the cancelled manual pass returns an empty summary with no completion event. No funds or tree state are affected, and the next pass rescans.

Expected behavior

A rebuild that cannot be admitted is refused before it stops any sync pass.

Detailed discussion

Proposed approach: take a rebuild admission before quiescing sync and hand it to the coordinator's reset, so the check cannot race a new operation, while an admitted rebuild still drains sync before touching the tree. Trade-off to settle: holding admission during the drain makes new operations wait behind it, and a sync completion handler that waits for a shielded operation would stall the drain until its budget runs out.

Prior work

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions