Skip to content

Change provider resolution algorithm for new data setΒ #302

@rvagg

Description

@rvagg

The current resolution algorithm that runs inside createContext() is quite complex because it's solving for a lot of things. At its heart it does:

  1. Find providers that you have data sets with
  2. Find data sets that match the metadata you're asking to create with (could be none, needs to be exact)
  3. Choose the one with the most pieces
  4. Otherwise create a new data set

It's not quite like that in the code, but that's the rough outline.

There's also handling for specific provider selection. And there's the forceCreateDataSet handling.

The algorithm is magnetic, it takes you to the heaviest matching data set if you have one.

But in the case that you need to make a new data set, for whatever reason - don't have one, don't have a matching one, have supplied forceCreateDataSet - due to the way the algorithm flows, you end up using the same provider anyway. So it's magnetic to your primary service provider, you don't really get variation unless you ask for it.

This is what we'd like to change: if you have to make a new data set, for whatever reason, then you should go back and be selecting a provider using the random algorithm (unless you provide a specific provider to use).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

πŸŽ‰ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions