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

Fixes shared #774

Merged
merged 26 commits into from
Oct 21, 2024
Merged

Fixes shared #774

merged 26 commits into from
Oct 21, 2024

Conversation

fonstack
Copy link
Member

@fonstack fonstack commented Oct 21, 2024

Summary by CodeRabbit

  • New Features

    • Updated HTTP header configuration to allow framing from the same origin.
    • Enhanced vault metadata and payout handling for better accuracy.
  • Bug Fixes

    • Improved error handling in the InScopeSection to prevent runtime errors.
  • Documentation

    • Updated response time for submission feedback from 12 hours to 24 hours in user notifications.
  • Chores

    • Version updated for the shared package to 1.1.122.

shayzluf and others added 25 commits July 22, 2024 19:24
chore: HAT vault now first + getting prices from camelot
chore: new payment splitter factory + pricing for HAT on mainnet
chore: duplicated addresses airdrop fixed
fix: `useUserHasCollectedSignature` not depending on `account` anymore
[FEAT] github connection + curator emails
Copy link
Contributor

coderabbitai bot commented Oct 21, 2024

Walkthrough

The changes in this pull request include updates to various files across the project. The package.json file for the @hats.finance/shared package has had its version incremented from 1.1.121 to 1.1.122. The HTTP header configuration in _headers has modified the X-Frame-Options from DENY to SAMEORIGIN. The parser.ts file has introduced new logic for vault descriptions and payout handling. Additionally, the English language JSON file has updated response times from 12 hours to 24 hours, and the InScopeSection.tsx file has improved error handling for potentially undefined properties.

Changes

File Path Change Summary
packages/shared/package.json Version updated from 1.1.121 to 1.1.122.
packages/web/public/_headers X-Frame-Options header modified from DENY to SAMEORIGIN.
packages/web/src/hooks/subgraph/vaults/parser.ts Modifications to overrideDescription, overridePayoutVault, and fixVaultsData functions for vault logic.
packages/web/src/languages/en.json Updated response times from "12 hours" to "24 hours" in responseNotice and submissionSection.
packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx Updated handling of vault.description.scope.codeLangs using optional chaining to prevent runtime errors.

Suggested reviewers

  • shayzluf

🐰 In the garden where changes bloom,
A version update clears the gloom.
Headers shift, a gentle sway,
Vaults now dance in a new ballet.
With every line, a story told,
In code we trust, our dreams unfold! 🌼


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

cloudflare-workers-and-pages bot commented Oct 21, 2024

Deploying dapp with  Cloudflare Pages  Cloudflare Pages

Latest commit: b91bd48
Status: ✅  Deploy successful!
Preview URL: https://c57c74d5.dapp-a9y.pages.dev
Branch Preview URL: https://fixes-shared.dapp-a9y.pages.dev

View logs

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: 0

🧹 Outside diff range and nitpick comments (1)
packages/web/src/hooks/subgraph/vaults/parser.ts (1)

111-111: Clarify the unit of honeyPotBalance for better readability

The value assigned to eulerCTFVault.honeyPotBalance is a large number represented as a string. To improve readability and prevent potential unit errors, consider clarifying the unit (e.g., wei, gwei, smallest token unit) either through a comment or by using a constant.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e3eea1a and b91bd48.

📒 Files selected for processing (5)
  • packages/shared/package.json (1 hunks)
  • packages/web/public/_headers (1 hunks)
  • packages/web/src/hooks/subgraph/vaults/parser.ts (1 hunks)
  • packages/web/src/languages/en.json (2 hunks)
  • packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/shared/package.json
🧰 Additional context used
🔇 Additional comments (5)
packages/web/public/_headers (1)

3-3: Verify the intentionality and implications of changing X-Frame-Options to SAMEORIGIN

The X-Frame-Options header has been changed from DENY to SAMEORIGIN. While this is still a secure option that prevents clickjacking attacks from external sites, it's slightly less restrictive than DENY. This change allows the page to be displayed in a frame on the same origin as the page itself.

Please address the following points:

  1. Confirm that this change is intentional and necessary for specific functionality (e.g., preview features, embedded content from the same site).
  2. Document the reason for this change in a comment or in the project documentation.
  3. Review the application for any features that now rely on this change and ensure they work as expected.
  4. Verify that there are no security implications within your same-origin content that could be exploited through framing.

To help verify the usage of iframes in your codebase, you can run the following script:

This will help identify where iframes are being used, which can guide your review of features that may be affected by this header change.

packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx (1)

233-236: Improved error handling with optional chaining

The addition of optional chaining (?.) to vault.description.scope?.codeLangs?.map is a good improvement. It prevents potential runtime errors if scope or codeLangs is undefined, making the code more robust without changing its functionality.

packages/web/src/languages/en.json (2)

1336-1337: Approved: Consistent update to response time expectation.

This change aligns with the previous modification, updating the expected response time from 12 hours to 24 hours. The consistency across different sections of the application is good for setting uniform user expectations.


1324-1325: Approved: Response time expectation updated.

The change from 12 hours to 24 hours for the expected response time is consistent and may set more realistic expectations. However, it's important to monitor how this affects user satisfaction.

To ensure this change is applied consistently throughout the application, run the following command:

This will search for any remaining instances of "12 hours" in other files, which might need to be updated for consistency.

✅ Verification successful

Consistent response time updates verified.

All instances of "12 hours" have been updated to "24 hours" across the codebase. No remaining instances found outside en.json.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

rg "12 hours" -g '!en.json'

Length of output: 29


Script:

#!/bin/bash
rg "12 hours" --glob '!en.json' .

Length of output: 35

packages/web/src/hooks/subgraph/vaults/parser.ts (1)

114-117: Update to Accumulated Finance vault description hash is correct

The code correctly updates the descriptionHash for the Accumulated Finance vault when it matches the specified old hash. This ensures the vault has the latest description.

@@ -1,6 +1,6 @@
# This is a comment
/*
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGIN
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this change about?

@shayzluf shayzluf merged commit 955f774 into develop Oct 21, 2024
4 checks passed
@fonstack fonstack deleted the fixes-shared branch October 21, 2024 13:51
This was referenced Nov 25, 2024
@coderabbitai coderabbitai bot mentioned this pull request Dec 5, 2024
@coderabbitai coderabbitai bot mentioned this pull request Dec 16, 2024
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