Skip to content

feat(remote): add WithFallbackToLocal option for chain lookups on network failure#179

Merged
graham-chainlink merged 2 commits intomainfrom
ggoh/add-fallback-to-local-option
Feb 9, 2026
Merged

feat(remote): add WithFallbackToLocal option for chain lookups on network failure#179
graham-chainlink merged 2 commits intomainfrom
ggoh/add-fallback-to-local-option

Conversation

@graham-chainlink
Copy link
Contributor

@graham-chainlink graham-chainlink commented Feb 9, 2026

Summary

This PR adds a WithFallbackToLocal() functional option to the remote package that enables automatic fallback to local embedded chain details when remote source was unable to be fetched due to network error.

Why This Change?

The fallback functionality provides resilience when remote data is temporarily unavailable or incomplete

Users can opt-in to this behavior by simply adding WithFallbackToLocal() to their function calls:

details, err := remote.GetChainDetailsBySelector(ctx, selector,
    remote.WithFallbackToLocal(), // Enables fallback to local data
)

Without this option, behavior remains unchanged (remote-only, returns error if not found).

@graham-chainlink graham-chainlink force-pushed the ggoh/add-fallback-to-local-option branch from 30cca16 to 1453c8c Compare February 9, 2026 03:22
@graham-chainlink graham-chainlink marked this pull request as ready for review February 9, 2026 03:28
@graham-chainlink graham-chainlink requested review from a team as code owners February 9, 2026 03:28
@graham-chainlink graham-chainlink force-pushed the ggoh/add-fallback-to-local-option branch from 1453c8c to 1d7b3e2 Compare February 9, 2026 05:44
@graham-chainlink graham-chainlink changed the title feat(remote): add WithFallbackToLocal option for chain lookups feat(remote): add WithFallbackToLocal option for chain lookups on network failure Feb 9, 2026
Introduce an option to fallback to embedded chain details on network failure for the remote api
@graham-chainlink graham-chainlink force-pushed the ggoh/add-fallback-to-local-option branch from 1d7b3e2 to fa714eb Compare February 9, 2026 05:46
@graham-chainlink graham-chainlink merged commit 086f4ac into main Feb 9, 2026
10 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/add-fallback-to-local-option branch February 9, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants