Skip to content

v2.9.3#1480

Merged
Patricie29 merged 9 commits intomainfrom
develop
May 12, 2025
Merged

v2.9.3#1480
Patricie29 merged 9 commits intomainfrom
develop

Conversation

@linkielink
Copy link
Member

Bugfixes

  • An error in the fallback logic to the public Pyth Hermes endpoint has been fixed

@vercel
Copy link

vercel bot commented May 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
mars-v2-frontend ✅ Ready (Inspect) Visit Preview May 12, 2025 7:24am

@linkielink linkielink requested review from Copilot and removed request for Patricie29 and StefChatz May 12, 2025 07:12

This comment was marked as outdated.

linkielink and others added 2 commits May 12, 2025 09:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@linkielink linkielink requested a review from Copilot May 12, 2025 07:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the fallback logic for the public Pyth Hermes endpoint to improve error handling during API calls. Key changes include:

  • Introducing a local variable to store the API response.
  • Implementing nested try blocks to separately handle primary and fallback API calls.
  • Changing the outer error handling to return an empty price array instead of throwing the exception.
Comments suppressed due to low confidence (1)

src/api/prices/getPythPrices.ts:45

  • [nitpick] If 'priceFeedIds' is always a one-dimensional array, the use of .flat() may be redundant and could be removed to improve clarity.
pythPrices/${priceFeedIds.flat().join('-')}

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the fallback logic for fetching Pyth prices from the public Pyth Hermes endpoint. Key changes include:

  • Wrapping the primary API fetch call in its own try block.
  • Adding a fallback fetch with proper error logging.
  • Returning an empty array in case both API calls fail.

@Patricie29 Patricie29 merged commit 2a74524 into main May 12, 2025
1 check 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.

3 participants