Skip to content

fix(kotlin-sdk): drop buffered shielded sync events from before a Clear or rebuild #6449

Backlog

Description

@lklimek

TL;DR: On Android, a shielded-tree inconsistency event queued before a Clear or rebuild can still reach a slow collector afterwards and raise the repair prompt again.

User story

As an Android wallet app developer, I want events that describe the wallet before a Clear or rebuild to be dropped, so users are not asked to repair a wallet they just repaired or cleared.

Scenario

Base flow

The app collects sync-completion events from PlatformWalletManager. A sync reports an inconsistent tree; the app rebuilds the tree or clears shielded data.

Actual behavior

Completions are queued in a buffered flow. Clear and rebuild do not fence events already in the buffer, so a slow collector can still receive the old inconsistency.

Expected behavior

Events from before a Clear or rebuild are discarded once it completes, as the Swift SDK already does with its callback generation.

Detailed discussion

Proposed approach: add a callback generation to the Kotlin manager that Clear and rebuild advance, and drop buffered events from an older generation. Ideally reuse a Rust-provided committed-tree identity so both hosts only compare values.

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