Skip to content

refactor(overlays): address S7059 async constructors in topic storage managers#104

Open
sirdeggen wants to merge 1 commit intomainfrom
sonar/w6-s7059-overlays
Open

refactor(overlays): address S7059 async constructors in topic storage managers#104
sirdeggen wants to merge 1 commit intomainfrom
sonar/w6-s7059-overlays

Conversation

@sirdeggen
Copy link
Copy Markdown
Contributor

Summary

  • Replace fire-and-forget async createIndex calls in 14 storage manager constructors with the .ready: Promise<void> pattern (S7059 fix)
  • Extract index setup into a private createIndices() / createSearchableIndex() method whose returned promise is assigned to this.ready
  • Parallelise independent createIndex calls via Promise.all in multi-index managers (Identity: 9 indices, KVStore: 5, BTMS: 3, TokenDemo: 2)
  • Remove narrating comments that explained what the code does (BTMS managers)

Affected files across @bsv/overlay-topics and @bsv/btms-backend:
IdentityStorageManager, KVStoreStorageManager, BTMSStorageManager (×2), DIDStorageManager, AppsStorageManager, TokenDemoStorage, AnyStorage, DesktopIntegrityStorage, FractionalizeStorage, HelloWorldStorage, MonsterBattleStorage, SlackThreadsStorage, SupplyChainStorage

Refs #38 #45.

Test plan

  • pnpm --filter @bsv/overlay-topics run build — passes (21 suites, 232 passed, 1 skipped)
  • pnpm --filter @bsv/overlay-topics run test — passes
  • pnpm --filter @bsv/btms-backend run build — passes
  • pnpm --filter @bsv/btms-backend run test — passes (43 tests)

🤖 Generated with Claude Code

… managers

Replace fire-and-forget async index creation in constructors with the `.ready:
Promise<void>` pattern, extracting index setup into private async methods and
parallelising independent createIndex calls via Promise.all. Covers all 14
affected storage managers across @bsv/overlay-topics and @bsv/btms-backend.
Refs #38 #45.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
20.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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