Skip to content

Activation task deduplication and SharedActivationCoordinator enhancements#5

Open
CharlVS wants to merge 3 commits intoKomodo-Community:devfrom
GLEECBTC:deduplicate-activation
Open

Activation task deduplication and SharedActivationCoordinator enhancements#5
CharlVS wants to merge 3 commits intoKomodo-Community:devfrom
GLEECBTC:deduplicate-activation

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Nov 26, 2025

Copied from upstream PR GLEECBTC#274

closes GLEECBTC#273

Summary

  • Ensures a single activation per AssetId across the SDK by routing all public activation calls through SharedActivationCoordinator and making ActivationManager idempotent at init.
  • Prevents balance/pubkeys from triggering overlapping coin-init while activation is pending by joining the in-flight activation.
  • Hardens event streaming to avoid WASM closure re-entrancy and post-dispose callbacks.

Acceptance criteria

  • One activation task per asset across concurrent callers.
  • No IndexedDB/storage uniqueness violations during activation + balance races.
  • No re-entrancy/after-dispose WASM closure errors under stress.
  • Activation responses parse reliably across protocols.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +232 to +236
scheduleMicrotask(() {
for (final asset in assets) {
coordinator
.activateAssetStream(asset)
.listen(controller.add, onError: controller.addError);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Close activation stream controller so callers can complete

When SharedActivationCoordinator is available, activateAssets now creates a broadcast controller and forwards each asset’s activation stream, but the controller is never closed or completed once the forwarded streams finish. As a result the returned stream never emits done, so any caller awaiting completion (e.g. await activateAssets([...]).last) will hang indefinitely and the controller/listeners stay live even after all activations end. The old implementation from ActivationManager.activateAssets completed normally, so this is a regression.

Useful? React with 👍 / 👎.

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.

2 participants