-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sdk-router): quote unmarshall hotfix [SLT-302] #3223
Conversation
WalkthroughThe changes in this pull request focus on enhancing the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/sdk-router/src/rfq/api.ts (2)
36-45
: Enhanced quote processing with individual error handling.The changes to quote processing are beneficial:
- Error handling for individual quotes prevents a single bad quote from causing the entire operation to fail.
- Filtering out null values ensures only valid quotes are returned.
These improvements make the function more robust and reliable.
Consider using
Array.prototype.flatMap
for a more concise implementation:return quotes.flatMap((quote) => { try { return [unmarshallFastBridgeQuote(quote)]; } catch (error) { console.error('Error unmarshalling quote:', error); return []; } });This approach combines the mapping and filtering steps, potentially improving readability and performance.
Line range hint
23-49
: Consider additional improvements for robustness and observability.While the current changes significantly improve the function, consider the following enhancements:
- Add more detailed logging, including request parameters and partial response data when available.
- Implement retry logic for transient failures.
- Add telemetry to track the success rate and performance of quote fetching and unmarshalling.
These suggestions could further improve the reliability and maintainability of the function. Would you like me to provide code examples for any of these improvements?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- packages/sdk-router/src/rfq/api.ts (1 hunks)
🔇 Additional comments (2)
packages/sdk-router/src/rfq/api.ts (2)
31-33
: Improved error logging for API response issues.The addition of error logging for non-OK responses is a good improvement. It provides more context for debugging API-related issues.
47-49
: Added error logging for fetch-related issues.The addition of error logging for fetch-related issues is a good improvement. It enhances the observability of network or other fetch-related problems.
Deploying sanguine-fe with
|
Latest commit: |
142159d
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f4c4bbea.sanguine-fe.pages.dev |
Branch Preview URL: | https://fix-sdk-unmarshall-hotfix.sanguine-fe.pages.dev |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3223 +/- ##
============================================
Coverage ? 90.63415%
============================================
Files ? 54
Lines ? 1025
Branches ? 82
============================================
Hits ? 929
Misses ? 93
Partials ? 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Bundle ReportChanges will increase total bundle size by 6.65MB (18.66%) ⬆️
ℹ️ *Bundle size includes cached data from a previous commit |
Description
A clear and concise description of the features you're adding in this pull request.
Additional context
Add any other context about the problem you're solving.
Metadata
Summary by CodeRabbit
Bug Fixes
null
for unsuccessful unmarshalling.Chores
null
values, ensuring only valid quotes are returned.