Skip to content

Show 404 on deprecated chain contract page #5139

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

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

MananTank
Copy link
Member

@MananTank MananTank commented Oct 23, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR updates the layout.tsx file to improve the handling of contract information and metadata, particularly addressing deprecated chain statuses and modifying the contract validation logic.

Detailed summary

  • Added a check for chainMetadata.status to call notFound() if the status is "deprecated".
  • Changed the variable used in isContractDeployed from info.contract to contract.
  • Adjusted the order of variable declarations for contract and chainMetadata.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link
Contributor

graphite-app bot commented Oct 23, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@MananTank MananTank marked this pull request as ready for review October 23, 2024 15:09
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 23, 2024
Copy link
Member Author

MananTank commented Oct 23, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @MananTank and the rest of your teammates on Graphite Graphite

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)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 4:55pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Oct 23, 2024 4:55pm
thirdweb_playground ⬜️ Skipped (Inspect) Oct 23, 2024 4:55pm
wallet-ui ⬜️ Skipped (Inspect) Oct 23, 2024 4:55pm

@vercel vercel bot temporarily deployed to Preview – wallet-ui October 23, 2024 15:09 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 23, 2024 15:09 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 23, 2024 15:09 Inactive
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.43%. Comparing base (3c77c6b) to head (09b7404).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5139   +/-   ##
=======================================
  Coverage   45.43%   45.43%           
=======================================
  Files        1066     1066           
  Lines       55150    55150           
  Branches     3974     3974           
=======================================
  Hits        25055    25055           
  Misses      29403    29403           
  Partials      692      692           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 3c77c6b
packages 40.45% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Copy link
Contributor

github-actions bot commented Oct 23, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.81 KB (0%) 857 ms (0%) 840 ms (+23.29% 🔺) 1.7 s
thirdweb (cjs) 102.66 KB (0%) 2.1 s (0%) 1.5 s (-2.75% 🔽) 3.5 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 46 ms (+31.97% 🔺) 142 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 48 ms (+49.07% 🔺) 58 ms
thirdweb/react (minimal + tree-shaking) 17.33 KB (0%) 347 ms (0%) 98 ms (-9.06% 🔽) 445 ms

Comment on lines +33 to +35
if (chainMetadata.status === "deprecated") {
notFound();
}
Copy link
Member

Choose a reason for hiding this comment

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

we need to show the user some more info for this down the line, fine for now

Copy link
Contributor

graphite-app bot commented Oct 23, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on improving the handling of contract metadata and checking for deprecated chains in the `layout.tsx` file. It ensures that the correct contract information is used and adds a condition to handle deprecated chain statuses.

### Detailed summary
- Added a check for `chainMetadata.status` to call `notFound()` if the status is "deprecated".
- Updated the `isValidContract` check to use `contract` from `info` instead of the previous variable.
- Rearranged the destructuring of `contract` and `chainMetadata` for clarity.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@MananTank MananTank force-pushed the 10-23-show_404_on_deprecated_chain_contract_page branch from c1230e6 to 09b7404 Compare October 23, 2024 16:52
Copy link

changeset-bot bot commented Oct 23, 2024

⚠️ No Changeset found

Latest commit: 09b7404

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel vercel bot temporarily deployed to Preview – wallet-ui October 23, 2024 16:52 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 23, 2024 16:52 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 23, 2024 16:52 Inactive
@graphite-app graphite-app bot merged commit 09b7404 into main Oct 23, 2024
30 checks passed
@graphite-app graphite-app bot deleted the 10-23-show_404_on_deprecated_chain_contract_page branch October 23, 2024 16:55
@vercel vercel bot temporarily deployed to Production – wallet-ui October 23, 2024 16:55 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground October 23, 2024 16:55 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 October 23, 2024 16:55 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants