fix(routing): keep query params when redirecting to the default mentor#335
Open
sonegillis1 wants to merge 1 commit into
Open
fix(routing): keep query params when redirecting to the default mentor#335sonegillis1 wants to merge 1 commit into
sonegillis1 wants to merge 1 commit into
Conversation
Visiting `/?embed=true&mode=anonymous&...` redirected to the resolved mentor with the query intact, then the SDK MentorProvider re-invoked redirectToMentor after landing — and since `pathname` was no longer `/`, it re-pushed a bare URL and stripped the embed/mode/component params. Guard redirectToMentor to bail out when already on the target mentor path, so the redundant re-redirect no longer drops the query string. Adds a provider unit test covering the no-op-when-already-on-target case.
Member
|
Claude finished @sonegillis1's task —— View job E2E Coverage Review
✅ E2E Coverage — No IssuesNo new app routes were introduced ( Coverage check: 545 checkpoints unchanged · 25/25 app pages mapped (100%) |
mamigot
approved these changes
Jul 14, 2026
mamigot
left a comment
Member
There was a problem hiding this comment.
✅ E2E Coverage — No Issues
No new app routes were introduced. All existing coverage is intact.
Coverage check result: 545 checkpoints unchanged, 25/25 app pages mapped (100%).
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.
Problem
Visiting
http://localhost:3001/?embed=true&mode=anonymous&extra-body-classes=iframed-externally&component=chatproduced:/?embed=…→/platform/<tenant>/<mentorId>?embed=…(query preserved ✓)/platform/<tenant>/<mentorId>(query stripped ✗)Expected: stay at step 1's URL with the params intact.
Root cause
redirectToMentorinproviders/index.tsxfires twice. It only preserved the query whenpathname === '/'. The SDKMentorProviderre-invokes it after the first redirect settles — by thenpathnameis/platform/<tenant>/<mentorId>, soqueryParamsis''and it re-pushes the bare URL, strippingembed/mode/component/etc.Fix
Guard
redirectToMentorto bail out when already on the target mentor path, so the redundant self-redirect doesn't drop the query string. All existing navigation behavior is otherwise untouched.Tests
Added a provider unit test asserting
redirectToMentoris a no-op (no re-push) when already on the target mentor. Full provider suite green (117 passed); full pre-push unit suite passed (10,564).Note
Pushed with
--no-verify(author-authorized): the pre-push suite passed butgit pushhit the repeated SIGPIPE-after-pass transport flake. Worth verifying in the browser that the embed URL now stays put; if a params-stripping second redirect persists, the SDKMentorProvidermay need a look too.🤖 Generated with Claude Code