Skip to content

fixed issue 618 642#761

Merged
Calebux merged 1 commit into
Calebux:mainfrom
devmasalati:feat/fixed
May 29, 2026
Merged

fixed issue 618 642#761
Calebux merged 1 commit into
Calebux:mainfrom
devmasalati:feat/fixed

Conversation

@devmasalati
Copy link
Copy Markdown

closes #618
closes #642

Summary:

I have implemented a centralized timeout and retry policy framework for all external dependencies in the backend. This ensures that transient failures in services like Gmail, Outlook, Stellar, and various payment gateways do not cause cascading failures or hang the application.

Key Changes

Centralized Service Policies

Created external-services.ts which defines specific timeoutMs and retryPolicy (max attempts, backoff, jitter) for each provider.
Providers covered: gmail, outlook, stellar_rpc, stripe, paystack, exchange_rates, llm, slack, telegram, and outbound_webhooks.
Unified External Service Client

Implemented external-service-client.ts as the standard way to make external requests.
Features built-in AbortController for timeouts and exponential backoff via a centralized retry utility.
Automatically tracks in-memory metrics (total requests, successes, failures, timeouts, retries).
Service Migrations

Migrated core services to use the new client:
Email/OAuth: gmail-token-service.ts, gmail-service.ts, outlook-service.ts.
Payments: paystack.ts.
Rates: frankfurter-provider.ts, fiat-provider.ts, crypto-provider.ts.
Notifications: slack-service.ts, telegram-bot-service.ts.
Others: llm-parser.ts, webhook-service.ts.
Updated blockchain-service.ts and email-service.ts to align with the new policy constants.
Metrics & Monitoring

Updated monitoring-service.ts to aggregate external service metrics.
Exposed a new admin endpoint in index.ts: GET /api/v1/admin/metrics/external-services.
Documentation & Testing

Added EXTERNAL_SERVICE_POLICIES.md detailing the policy for each service.
Added unit tests in external-service-client.test.ts to verify timeout enforcement and retry behavior.
All automated tests passed, confirming that the new client correctly handles service timeouts and retries according to the defined policies.

@devmasalati devmasalati requested a review from Calebux as a code owner May 29, 2026 10:15
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@devmasalati 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! 🚀

Learn more about application limits

@Calebux Calebux merged commit 949ec27 into Calebux:main May 29, 2026
7 of 17 checks passed
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.

[P1] Define service-level timeouts and retries for external dependencies [P2] Audit command palette coverage for key workflows

3 participants