fix: Insert a new route after the existing /profile route and before the /:selection_plan_id catch-all#87
Open
matiasperrone-exo wants to merge 1 commit into
Conversation
…the /:selection_plan_id catch-all
martinquiroga-exo
requested changes
Apr 23, 2026
martinquiroga-exo
left a comment
There was a problem hiding this comment.
@matiasperrone-exo please see comments. Thanks.
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.
Task:
Ref.: https://app.clickup.com/t/86b959jmg
Context
When a user with no speaker profile lands on
/app/{summit}/all-plans/{id}/profile,the following redirect loop occurs:SummitLayoutdetects no speaker profile and redirects to/app/{summit}/all-plans/{SP_LANDING}/profileAllPlansLayoutthen is matched by/:selection_plan_id(\\d+)catch-all, so it entersSelectionPlanLayoutSelectionPlanLayoutchecks summit.selection_plans(only active/submittable plans), so if plan not found, redirects to/app/{summit}/all-plansThe root cause: the profile sub-route (
/all-plans/{id}/profile) is caught bySelectionPlanLayout's allowed-plan guard even though the profile page has nothing to do with submission access.Proposed Fix:
Add a dedicated route for
/:selection_plan_id/profilebefore the/:selection_plan_idcatch-all that leads toSelectionPlanLayout. This intercepts the profile URL and rendersProfilePagedirectly, bypassing the allowed-plan guard entirely.Fix - One file change:
src/layouts/all-plans-layout.js:Add a dedicated route for
/:selection_plan_id/profilebefore the/:selection_plan_idcatch-all that leads toSelectionPlanLayout. This intercepts the profile URL and rendersProfilePagedirectly, bypassing the allowed-plan guardentirely.
Change:
File:
src/layouts/all-plans-layout.jsIn the
<Switch>block (currently lines 47–54), insert a new route after the existing/profileroute and before the/:selection_plan_idcatch-all:Why this works:
<Switch>matches the first route that fits. The new strict exact route for/:id/profileis more specific and appears before the /:id catch-all, so it wins.selectionPlansSettings[selectionPlanId]customization), so passing it here is correct.SelectionPlanLayoutneeded; it still handles presentations and other sub-routes as before./all-plans/profileroute (no plan ID) is unaffected.Critical files:
src/layouts/all-plans-layout.js: only file to modifysrc/layouts/selection-plan-layout.js: read-only reference (no changes)src/layouts/summit-layout.js: read-only reference (contains the redirect-to-profile logic that triggers the loop)Verification:
/app/{summit}/all-plans/{any_id}/profileas a user with no speaker profile: page should render the profile form without looping./app/{summit}/all-plans/{valid_id}/profileas a user with a speaker profile: profile page renders./app/{summit}/all-plans/{invalid_id}/profile: profile page renders (no redirect, plan guard is bypassed intentionally for profile)./app/{summit}/all-plans/profile: profile page renders as before./app/{summit}/all-plans/{id}/presentations: still goes throughSelectionPlanLayoutwith full allowed-plan guard.