[digital-carbon
] Handle potential sync breakages
#178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Potential sync issues addressed:
Unsupported registries
:In the past, tokens from the c3 factory have occasionally had registry values not in the
Registry
enum, which have broken the subgraph sync.This PR adds a fallback in case c3 issues credits for registries not in the registry enum so there is no break in production. A
Debug
entity is created when an unsupported registry so the problem can be further assessed and a fix deployed.handle null values from
loadRetire
:loadRetire
should never come back null either in practice or by design (therefore it does not follow the load/create pattern). However if a retire comes does back null from this function it will break the sync, as the subgraph will attempt to access a property on null.This issue has never come up afaik. In the rare event it does this will return before the subgraph attempts to access the property and create a
Debug
entity.