Repository navigation
fix(embedded): prevent datasource chat redirect loop - #1417
Merged
Merged
Conversation
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.
Summary
Fixes #1409. Starting Q&A from a datasource in a type-4 page-embedded assistant (
busiFlag: 'ds') now opens Chat inside the embedded page and supports returning to the datasource list.The loop occurred because protected routes required a normal login token, while the login redirect accepted the UID loaded by embedded authentication. Require both the token and UID for that redirect. Preserve the selected datasource ID, embedded handshake query parameters, and datasource list state; retain existing route allowlists and permission checks.
Evidence
e028a237; real Vue Router alternates between Chat and login until the test's navigation limit stops it.After: on
ad90677a,python -m pytest -q backend/tests/test_embedded_datasource_navigation.py backend/tests/test_embedded_auth_bypass_fix.pypasses 44 tests. The tests execute source handlers, actual Vue Router, and the compiled embedded component with isolated service/child-component stubs. They cover normal login, denied routes, model-check failure, embedded context, datasource ID precision, and returning/reopening Chat.frontend:npm run buildand ESLint for the four changed Vue/TypeScript files pass. Ruff check/format pass for the new regression file. Existing local dependencies were reused without syncing (Vue 3.5.40, Vue Router 4.6.4, TypeScript 5.7.3).Merge Danger
Door: two-way
Frontend-only behavior change; no migration, dependency, or embedded authentication protocol change.
Blast Radius: navigation
Affects the embedded datasource-to-Chat transition and the normal-login redirect when a UID exists without a login token.