Skip to content

chore: add createMany use case (Batch accounts 3/5)#610

Open
gantunesr wants to merge 4 commits into
gar/feat/batch-accounts/part-2from
gar/feat/batch-accounts/part-3
Open

chore: add createMany use case (Batch accounts 3/5)#610
gantunesr wants to merge 4 commits into
gar/feat/batch-accounts/part-2from
gar/feat/batch-accounts/part-3

Conversation

@gantunesr
Copy link
Copy Markdown
Member

@gantunesr gantunesr commented May 14, 2026

Stack part 3 of 5 split from #601. Adds AccountUseCases.createMany, bounded account creation concurrency, deduping/idempotency, bulk insertion, and mutation serialization. No public keyring RPC is wired in this part.


Note

Medium Risk
Touches core account creation/deletion flows by introducing mutation serialization and changing create to emit account-created events even when reusing an existing account; concurrency/bulk-insert paths may surface race or ordering issues.

Overview
Adds AccountUseCases.createMany to create multiple accounts in one call, deduping duplicate derivation paths, reusing existing accounts, creating missing ones with a small concurrency cap, and persisting via insertMany while scheduling background full scans only for newly-created/synchronized accounts.

Refactors derivation-path handling into shared helpers and introduces a simple mutation queue (#runAccountMutation) to serialize account mutations; create and delete now run under this queue, and create now emits emitAccountCreatedEvent even when the account already exists.

Updates unit tests to cover createMany behaviors (reuse, dedupe, error propagation, in-flight create ordering) and documents the new use case in the changelog.

Reviewed by Cursor Bugbot for commit 6e52eb8. Bugbot is set up for automated code reviews on this repo. Configure here.

@gantunesr gantunesr requested a review from a team as a code owner May 14, 2026 21:02
@gantunesr gantunesr changed the title [Batch accounts 3/6] Add internal batch account creation use case chore: add internal batch account creation use case (Batch accounts 3/6) May 14, 2026
@gantunesr gantunesr changed the title chore: add internal batch account creation use case (Batch accounts 3/6) chore: add internal batch account creation use case (Batch accounts 3/5) May 14, 2026
@gantunesr gantunesr changed the title chore: add internal batch account creation use case (Batch accounts 3/5) chore: add createMany use case (Batch accounts 3/5) May 14, 2026
@gantunesr gantunesr force-pushed the gar/feat/batch-accounts/part-2 branch from 16a6861 to 4670591 Compare May 14, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant