-
Notifications
You must be signed in to change notification settings - Fork 13
Sync: Merge prod invite graph changes to dev #1645
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
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
dba133a
hotfix: grafana link broken in invite graph
Hugo0 d1a8f7c
feat(invite-graph): new users indicator and progressive inactive fade
Hugo0 b82a269
feat(invite-graph): add per-user external edge data and improve UI
Hugo0 24c1242
feat(invite-graph): enable search for external nodes with custom labels
Hugo0 986b45c
feat(invite-graph): activity filtering + logarithmic edge animations
Hugo0 16fdf6f
feat(graph): add payment-graph mode and top-nodes slider for full-graph
Hugo0 87b5d3b
graph fixes
Hugo0 8608676
chore: remove debug logging from InvitesGraph after fixing orphan mer…
Hugo0 780b64a
fix: apply prettier formatting to InvitesGraph
Hugo0 409e1a5
refactor: remove debug logs and add safety assertions
Hugo0 c0c25c6
feat: add payment mode support to types and preferences
Hugo0 faed87f
Merge pull request #1630 from peanutprotocol/feat/payment-graph-and-t…
Hugo0 2b87dd6
fix: update user details if missing during KYC process and reset erro…
kushagrasarathe 16816bd
fix: prevent data corruption by updating user fields independently
kushagrasarathe b942bda
Merge pull request #1631 from peanutprotocol/hot-fix/kyc-cta
jjramirezn 81c454f
feat: switch payment graph to password-based auth
Hugo0 b9f5a35
Merge pull request #1634 from peanutprotocol/feat/payment-graph-and-t…
Hugo0 c2888c5
fix: pass password to getExternalNodes for payment mode
Hugo0 7523703
fix: correct kkonrad username in full-graph whitelist
Hugo0 3fb95a9
feat: disable squid withdrawals
jjramirezn 6bb7377
Merge pull request #1636 from peanutprotocol/feat/disable-squid-withdraw
Hugo0 358d731
Merge peanut-wallet (prod) into peanut-wallet-dev
Hugo0 1b5c491
style: run prettier on InvitesGraph files
Hugo0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| 'use client' | ||
|
|
||
| import { usePathname } from 'next/navigation' | ||
| import { notFound } from 'next/navigation' | ||
| import { IS_DEV } from '@/constants/general.consts' | ||
|
|
||
| // Routes that are allowed in production (protected by API key / user check) | ||
| const PRODUCTION_ALLOWED_ROUTES = ['/dev/full-graph', '/dev/payment-graph'] | ||
|
|
||
| export default function DevLayout({ children }: { children: React.ReactNode }) { | ||
| const pathname = usePathname() | ||
|
|
||
| // In production, only allow specific routes (full-graph, payment-graph) | ||
| // Other dev tools (leaderboard, shake-test, dev index) are dev-only | ||
| if (!IS_DEV) { | ||
| const isAllowedInProd = PRODUCTION_ALLOWED_ROUTES.some((route) => pathname?.startsWith(route)) | ||
| if (!isAllowedInProd) { | ||
| notFound() | ||
| } | ||
| } | ||
|
|
||
| return <>{children}</> | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🌐 Web query:
Next.js notFound() function server-only client component behavior💡 Result:
What
notFound()does (App Router)notFound()is control flow, not a render helper: calling it throws a special internal error (NEXT_HTTP_ERROR_FALLBACK;404) that immediately stops rendering for the current route segment and causes Next.js to render that segment’snot-found.(js|tsx)UI (and injectsnoindex). [1]not-found.(js|tsx)is the file that renders whennotFound()is thrown in that segment (and the rootapp/not-foundalso handles unmatched URLs). By default it’s a Server Component; you can make it a Client Component if you need client hooks, but then you must do client-side data work yourself. [2]Where you can (and can’t) use it
'use client'): callingnotFound()there is not a supported way to show a 404 boundary.Practical patterns when you “need 404” from client code
notFound()there. [1]notFound()(or return a flag), then refresh/navigate accordingly. [3]router.replace('/somewhere')) or render your own “not found” UI—don’t rely onnotFound()from the client.Sources: Next.js
notFound()docs [1], Next.jsnot-foundfile docs [2], Next.js source comment describing supported environments [3].🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 102
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 4655
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 527
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 1028
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 50
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 136
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 365
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 315
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 123
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 238
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 130
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 590
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 457
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 1713
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 236
🏁 Script executed:
Repository: peanutprotocol/peanut-ui
Length of output: 50
Remove
notFound()from this Client Component; use server-side guard instead.notFound()is not supported in Client Components. It will not set a 404 status and may fail silently. Since the guard requiresusePathname()(a client hook), the cleanest fix is to move the permission check to a parent Server Component or wrap this layout in a server-side guard.Alternatively, if keeping it as a Client Component, use client-side redirect on mount:
Client-side redirect pattern
'use client' import { usePathname, useRouter } from 'next/navigation' -import { notFound } from 'next/navigation' +import { useEffect } from 'react' import { IS_DEV } from '@/constants/general.consts' const PRODUCTION_ALLOWED_ROUTES = ['/dev/full-graph', '/dev/payment-graph'] export default function DevLayout({ children }: { children: React.ReactNode }) { const pathname = usePathname() + const router = useRouter() + + useEffect(() => { + if (!IS_DEV && pathname) { + const allowed = PRODUCTION_ALLOWED_ROUTES.some( + (route) => pathname === route || pathname.startsWith(`${route}/`) + ) + if (!allowed) { + router.replace('/') + } + } + }, [IS_DEV, pathname, router]) // In production, only allow specific routes (full-graph, payment-graph) // Other dev tools (leaderboard, shake-test, dev index) are dev-only - if (!IS_DEV) { - const isAllowedInProd = PRODUCTION_ALLOWED_ROUTES.some((route) => pathname?.startsWith(route)) - if (!isAllowedInProd) { - notFound() - } - } return <>{children}</> }Note:
startsWithalone allows unintended prefixes (e.g.,/dev/full-graphx); the fix above uses exact-or-subpath matching.🤖 Prompt for AI Agents