Repository navigation
fix: resilience for analytics, Soroban and Horizon calls; remove unsafe any casts - #605
Merged
martinzhames merged 2 commits intoOct 23, 2026
Conversation
…e unsafe any casts dupdab#453: analytics view refresh logs failures, alerts admins on failure or runs over 60s, exposes duration and last-success Prometheus metrics, and can be triggered by a superadmin via POST /admin/analytics/refresh. dupdab#454: Soroban RPC calls retry with exponential backoff, fall back to SOROBAN_RPC_FALLBACK_URL, open a circuit after 5 consecutive failures and raise an admin alert when it opens. dupdab#455: Horizon calls go through a circuit breaker with a state metric and admin alert; Stellar polling pauses while the circuit is open. dupdab#456: remove every `as any` cast from production code in favour of typed shapes. Closes dupdab#453 Closes dupdab#454 Closes dupdab#455 Closes dupdab#456
|
@unrealtim-tech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…-resilience-and-type-safety # Conflicts: # src/runtime-config/runtime-config-admin.controller.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
AnalyticsRefreshService.refresh()wraps the refresh in try/catch with detailed logging, raises ananalytics_refreshadmin alert on failure or after 60s, and recordsanalytics_refresh_duration_secondsandanalytics_refresh_last_success_timestamp_seconds.POST /admin/analytics/refresh(superadmin) triggers it manually. Adds theanalytics_refreshalert type with a migration.SorobanServiceandStellarServiceuse a sharedSorobanRpcResiliencehelper: 3 attempts with exponential backoff, optional fallback endpoint fromSOROBAN_RPC_FALLBACK_URL, a circuit breaker that opens after 5 consecutive failures, and an admin alert when it opens.StellarServicego through a circuit breaker with thestellar_horizon_circuit_stategauge and an admin alert on open.StellarMonitorServiceskips polling while the circuit is open instead of failing.anytype casts from cache and auth services #456: removed allas anycasts in production code (cache/auth casts from the issue were already gone) using typed local shapes;strict: truewas already enabled intsconfig.json.Notes
opossumis not a dependency and dependencies were not changed, so the breaker is a small in-repo implementation (src/common/circuit-breaker.ts).AnalyticsRefreshServiceandSorobanServicetake new injected services (AdminAlertService;SorobanServicealso an optional fallback client); existing specs that construct them directly were not updated.Closes #453
Closes #454
Closes #455
Closes #456