Skip to content

fix(platform-wallet): restart background shielded sync when a rebuild is abandoned by its caller #6447

Backlog

Description

@lklimek

TL;DR: If a Rust caller drops the shielded-tree rebuild before it finishes, periodic shielded sync can stay stopped until something starts it again.

User story

As a developer using the Rust platform-wallet, I want background shielded sync to keep its previous running state even when I cancel a rebuild, so my app does not silently stop syncing.

Scenario

Base flow

Background shielded sync is running. The app calls rebuild_shielded_tree and then drops the returned future, for example on a timeout or task cancellation.

Actual behavior

The rebuild first pauses background sync. Its restart runs only after the awaited reset returns, so dropping the future during the pause or while waiting for the store lock leaves sync stopped.

Expected behavior

Either the rebuild completes as a manager-owned operation that restores the previous sync state on every path, or dropping it restores that state.

Detailed discussion

Proposed approach: run the reset and restart as a manager-owned task with the same stop ordering as today, and have the public method only await its completion. The C export waits synchronously and is not affected.

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