Repository navigation
fix: dead link, duplicate course fetches, redirect validation, lazy dashboard tabs - #672
Merged
DeFiVC merged 4 commits intoOct 24, 2026
Conversation
…g /transactions The View Transactions link targeted a route that does not exist, sending users to a 404. Point it at /rewards, which already shows reward history.
useCourses() and useInfiniteCourses() each requested the catalog on mount. Add useEnrollments() for enrollment badges so the listing only uses useInfiniteCourses for course data.
…t param Extend isSafeRedirectPath to reject javascript:/data:/vbscript: style schemes and control characters used in open-redirect bypasses, and cover the acceptance criteria with tests.
Add an enabled option to useCourses, useRecommendedCourses, useRewards and useCredentials. The dashboard now gates each section by the active tab, replaces the global loading gate with per-section skeletons, and memoizes fetches so switching tabs does not re-request data.
❌ Deploy Preview for chainlearn failed.
|
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #516, Closes #517, Closes #518, Closes #519
Type of Change
Summary
This PR fixes four navigation, networking, and security issues: a dead "View Transactions" link that 404s, duplicate catalog requests on the courses page, an unvalidated middleware
redirectparameter, and dashboard hooks that fetch every tab's data on mount.Motivation / Context
Closes #516, Closes #517, Closes #518, Closes #519.
Changes
balance-display.tsxlink now points to/rewards(label updated to "View Rewards") instead of the non-existent/transactionsuseEnrollments()and switched the courses listing touseInfiniteCourses+useEnrollments, removing the duplicateuseCourses()catalog requestisSafeRedirectPathto reject protocol schemes (javascript:,data:, …) and control characters; added testsenabledoptions touseCourses/useRecommendedCourses/useRewards/useCredentials; dashboard gates fetches by active tab, uses per-section skeletons, and memoizes fetches across tab switchesTesting
src/tests/wallet/balance-display.test.tsxfor the/rewardslink targetsrc/middleware.test.tscases forjavascript:,data:,vbscript:, embedded schemes, and control-character bypassesnpm/vitestruns were intentionally skipped in this environment; CI should validate the suiteTradeoffs
isSafeRedirectPathrejects any redirect containing a colon-scheme pattern (e.g./foo:bar), falling back to/dashboard. Internal routes in this app do not use colons.Out of scope
/transactionspage