Skip to content

Fix unhandled promise rejection in horizon ping timeout - #1892

Merged
sublime247 merged 1 commit into
sublime247:mainfrom
OluwapelumiElisha:1779-Bug-Resolve-unhandled-promise-rejection-on-Horizon-node-timeout
Aug 28, 2026
Merged

Fix unhandled promise rejection in horizon ping timeout#1892
sublime247 merged 1 commit into
sublime247:mainfrom
OluwapelumiElisha:1779-Bug-Resolve-unhandled-promise-rejection-on-Horizon-node-timeout

Conversation

@OluwapelumiElisha

Copy link
Copy Markdown
Contributor

Description

Resolves an unhandled promise rejection in the Stellar service when a Horizon node times out.

Previously, pingHorizon utilized Promise.race alongside a setTimeout function. If the network call resolved successfully before the timeout expired, the timeout promise would eventually reject in the background, causing an "Unhandled Promise Rejection" error that couldn't be caught by the outer block.

This PR properly clears the background timeout when the race resolves, preventing the rogue rejection and ensuring a cleaner execution profile and better system stability.

Changes Made

  • Added a clearTimeout handler to the pingHorizon method in src/services/stellar/stellarService.ts.

Related Issues

Fixes #1779

@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@OluwapelumiElisha 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

@sublime247
sublime247 merged commit d467964 into sublime247:main Aug 28, 2026
2 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.

[Bug] Resolve unhandled promise rejection on Horizon node timeout

2 participants