Skip to content
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: Links Map in defi.ts #900

Merged
merged 1 commit into from
Oct 25, 2024
Merged

fix: Links Map in defi.ts #900

merged 1 commit into from
Oct 25, 2024

Conversation

Abeeujah
Copy link
Contributor

@Abeeujah Abeeujah commented Oct 22, 2024

Bug Fix

  • Bugfix

Resolves: #888

Haiko Solvers

Providing haiko_solvers in the linkMap resolves the issue of some protocol links not redirecting to liquidity.

Summary by CodeRabbit

  • New Features

    • Introduced a new link for the "Provide Liquidity" action in the haiko_solvers application, enhancing user navigation to the relevant section.
  • Bug Fixes

    • No bug fixes were implemented in this release.

Copy link

vercel bot commented Oct 22, 2024

@Abeeujah is attempting to deploy a commit to the LFG Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Oct 22, 2024

Walkthrough

The changes involve the addition of a new entry in the linkMap object within the utils/defi.ts file. This entry maps the action "Provide Liquidity" to the URL "https://app.haiko.xyz/positions" specifically for the haiko_solvers application. The existing functionality of the getRedirectLink function remains unchanged, ensuring that it continues to operate as before for other applications.

Changes

File Change Summary
utils/defi.ts Added mapping for "Provide Liquidity" action to "https://app.haiko.xyz/positions" for haiko_solvers.

Assessment against linked issues

Objective Addressed Explanation
Add working protocol links for liquidity redirection (#[888])

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 319c642 and 6224a0e.

📒 Files selected for processing (1)
  • utils/defi.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • utils/defi.ts

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 41bb6d8 and 72edacf.

📒 Files selected for processing (1)
  • utils/defi.ts (1 hunks)
🧰 Additional context used

utils/defi.ts Outdated
Comment on lines 46 to 48
haiko_solvers: {
"Provide Liquidity": "https://app.haiko.xyz/positions",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider consolidating haiko entries.

Since both "haiko" and "haiko_solvers" map to the same URL, consider consolidating them into a single entry using a more generic key, or document why both entries are necessary.

Example consolidation approach:

  haiko: {
    "Provide Liquidity": "https://app.haiko.xyz/positions",
  },
- haiko_solvers: {
-   "Provide Liquidity": "https://app.haiko.xyz/positions",
- },

Then update the calling code to use "haiko" consistently.

Committable suggestion was skipped due to low confidence.


💡 Codebase verification

Remove redundant haiko entry and keep only haiko_solvers

Based on the codebase analysis:

  • Both haiko and haiko_solvers entries have identical URLs
  • The haiko_solvers entry is specifically referenced in appIcon.tsx for favicon handling
  • The test file only references "Haiko" in a different context (allocation data)
  • There's no evidence of the plain haiko entry being used anywhere in the codebase

Recommendation:

  • Remove the redundant haiko entry
  • Keep only the haiko_solvers entry as it's actively used in the UI components
🔗 Analysis chain

LGTM! Verify if both haiko entries are needed.

The implementation correctly adds the link mapping for haiko_solvers, which should fix the redirection issue mentioned in #888.

Let's verify the usage of both haiko entries in the codebase:


Let me gather more information to understand the full context of haiko usage.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to both haiko variations to understand if both entries are needed
echo "Searching for haiko_solvers usage:"
rg -i "haiko_solvers" -A 3
echo -e "\nSearching for haiko usage:"
rg -i '"haiko"' -A 3

Length of output: 629


Script:

#!/bin/bash
# Search for haiko without quotes to catch all variations
echo "Searching for any haiko references:"
rg -i "haiko" -A 3

# Search for protocol related patterns that might use haiko
echo -e "\nSearching for protocol related patterns:"
rg -i "protocol.*haiko|haiko.*protocol" -A 3

# Look for any URL patterns matching haiko
echo -e "\nSearching for haiko URLs:"
rg -i "https?://.*haiko" -A 3

Length of output: 1604

Copy link

vercel bot commented Oct 23, 2024

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

Name Status Preview Comments Updated (UTC)
starknet-quest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 10:45am

Copy link
Contributor

@fricoben fricoben left a comment

Choose a reason for hiding this comment

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

You need to rebase and we're good !

@fricoben fricoben added the ❌ Change request Change requested from reviewer label Oct 23, 2024
@Abeeujah Abeeujah closed this Oct 23, 2024
@Abeeujah Abeeujah reopened this Oct 23, 2024
@Abeeujah
Copy link
Contributor Author

Hi @fricoben thanks for pointing it out, Commit History has been linearized.

Copy link
Contributor

@fricoben fricoben left a comment

Choose a reason for hiding this comment

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

lgtm

@fricoben fricoben merged commit c559051 into lfglabs-dev:testnet Oct 25, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❌ Change request Change requested from reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some protocol links in earn which redirects to Liquidity are not working !
2 participants