Skip to content

resolveByDataSetId doesn't check metadata consistency #485

@rvagg

Description

@rvagg

Thanks to #438 I'm noticing that when you select a specific data set it doesn't check your metadata matches. It only checks that withCDN matches. We need to figure out the strategy here and it's a little bit tricky.

In resolveByProviderId we do a metadataMatches using requestedMetadata. But in that case you're fishing for a matching data set, in the resolveByDataSetId case you've already explicitly selected one, so is it the SDK's business to be checking that it matches the metadata you requested. Currently we do some checking, withCDN must match the data set. So we're doing a half-way job, which isn't good. I think we should either go further, or do nothing:

Options:

  1. Strictly require that requestedMetadata matches the data set and error if not (this value is made in resolveProviderAndDataSet and could just be moved up to before the call to resolveByDataSetId).
  2. Only require that meta data matches if you provide some in your options - including withCDN being set. If withCDN && metadata are both undefined then perform no checks.
  3. Perform no checks at all, including withCDN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🐱 Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions