Skip to content

refactor(vault): Atomic bulk move via single Room transaction #46

Closed

Description

@OffRange

2. Atomic bulk move via single Room transaction

MoveItemsToVaultUseCase rewraps and persists items one-at-a-time. If item K fails mid-loop, items 0..K-1 are already moved — partial-success state.

Cleaner approach: collect all rewrapped Passwords first, then a single database.withTransaction { ... } upsert. Eliminates the partial-failure window. Requires either a new PasswordRepository.bulkUpsert(passwords: List) API, or wrapping the loop in a higher-level transaction.

Out of scope for the initial PR because the partial-failure case is rare (crypto failures don't normally occur after vault validation has passed) and the bulk-transactional path is a meaningful refactor.

Activity

  1. added a commit that references this issue on May 4, 2026
    f0d6a71
  2. OffRange commented on May 5, 2026

    @OffRange
    OwnerAuthor

    #44 got merged

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions