Skip to content

Don't rely (just) on cdnRailId for withCDN check #184

@rvagg

Description

@rvagg

See FilOzone/filecoin-services#161

Currently we have this code (in two places):

withCDN: dataSet.cdnRailId > 0, // CDN is enabled if cdnRailId is non-zero (should be more reliable than metadata)

Which turns out to not be true. Termination of a CDN service by FilCDN will:

  1. Terminate the rails
  2. Reset the metadata to remove withCDN (so it's actually a more reliable indicator than the code comment above suggests)
  3. Set cdnEndEpoch to be the current epoch (via the railTerminated callback from Payments) instead of 0

The CDN rail IDs are left intact after this operation.

So we either need to bother with fishing around in metadata, or we should check cdnEndEpoch==0 as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🎉 Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions