Repository navigation
Kai Code: Keep the start URL's query when redirecting to start a product tour - #218
Merged
TobiasDuelli merged 1 commit intoNov 16, 2026
Conversation
…#229004) A start URL with a query string got a second '?', so the gleap_tour param was lost after the redirect and the tour never started. Co-Authored-By: Claude <noreply@anthropic.com>
TobiasDuelli
approved these changes
Nov 16, 2026
TobiasDuelli
deleted the
kai-code/6afb09cb89dd294a61737312-addb9dd0-e586-40d7-80dd-0c08d96f8b8f
branch
November 18, 2026 20:33
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.
Warning
Root cause: When a checklist step starts a product tour from another page, the SDK sends the visitor to the tour's start page with the tour ID added to the address. It always added it after a "?". This tour's start address already contains a "?" (
?view=list), so the link ended up with two "?" marks. The customer's app then showed a different view, and the SDK couldn't find the tour ID, so the tour never started. Gleap still listed the visitor as a recipient, because it records the tour as sent before it is drawn on the page.Tip
Fix: The redirect now adds the tour ID to the address's existing settings (
?view=list&gleap_tour=…) and keeps any#part at the end. The tour starts after the redirect. The change is inJavaScript-SDK/src/Gleap.js, andsrc/GleapProductTourStart.test.jstests it.Automated changes by Kai Code.
When a checklist step (or banner/modal/messenger action) starts a product tour on another page,
Gleap.startProductTourredirected to${startURL}?gleap_tour=…&gleap_tour_delay=1. A start URL that already has a query (e.g./workspaces?view=list) became?view=list?gleap_tour=…: the host app got a corruptedviewvalue andcheckForUrlParamsfound nogleap_tourparam, so the tour never started after the redirect (Gleap #229004).The redirect URL is now built with the URL API (
Gleap.buildTourStartUrl), which appends the tour params to the existing query, keeps the hash, and resolves relative start URLs; a string fallback picks&vs?if the URL can't be parsed. Regression tests insrc/GleapProductTourStart.test.jscover a start URL without a query, with a query, and with a hash.Not changed: the server still records the tour as sent when the config is fetched, before the tour renders.
🤖 Generated with Claude Code
Gleap ticket: View in Gleap
Checked by Kai Code
src/GleapProductTourStart.test.jsfails on the base branch and passes with this change (npm test -- $KAI_TESTS)test(3 s)