Skip to content

Premature Swap page entry prompts competing activations #3302

@smk762

Description

@smk762

We need to avoid cases where triggers for activation (e.g. via form coin selection) do not result in multiple competing activation tasks for the same coin. This inevitably leads to task failures, which can cascade into failing retries and downstream errors like this:

{
    "_type": "TASK:6",
    "message": {
        "status": "Error",
        "details": {
            "error": "Error on platform coin KMD creation: Error saving HD account to storage: Error uploading an item: DomException { obj: Object { obj: JsValue(ConstraintError: Unable to add key to index 'wallet_account_id': at least one key does not satisfy the uniqueness requirements.\nundefined)"
        }
    }
}

In the screenshots and logs below:

  • 18 tasks are created to activate 2 coins.
  • Task 18 succeeds for KMD
  • Task 16 succeeds for BTC

We've effectively sabotaged all of the earlier activation attempts by retrying too quickly.

To Reproduce

  1. Login via import of a mature wallet
  2. Before KMD has a chance to activate, go to the Swap page.
  3. See cascade of errors in console logs

Screenshots

Image Image Image Image

Expected behavior
Ideally, we should have awareness of tickers which have incomplete activation tasks, and avoid stacking up more until the existing task either succeeds or fails.

Found in
ebb3f74 0.9.3 RC

Environment:

  • Platform: [e.g. Desktop/Mobile]
  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Build mode [e.g. Debug/Release]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

P1Major issue needs to be fixedUXCosmetic or flow efficiency enhancements for improved User ExperiencebugSomething isn't workingperformanceWhere data sourcing or rendering speed needs improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions