Skip to content

fix(embedded): prevent datasource chat redirect loop - #1417

Merged
ulleo merged 1 commit into
mainfrom
fix/1409-embedded-datasource-chat
Oct 26, 2026
Merged

ulleo merged 1 commit into
mainfrom
fix/1409-embedded-datasource-chat

Conversation

@ulleo

@ulleo ulleo commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

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.

 Start Q&A from an embedded datasource
- /chat/index → /login → /chat/index → …
+ /embeddedCommon → embedded Chat → return to 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

  • Before: the four new regression cases fail on base 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.py passes 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 build and 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).
  • Manual browser verification reported by the tester: after adding the local embedded user, clicking “开始问数” worked without the freeze. Browser verification did not cover returning to the datasource list or the full SQL/LLM pipeline; those are not claimed as end-to-end passes. No image deployment was performed.

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.

@ulleo
ulleo merged commit 9db497c into main Oct 26, 2026
3 checks passed
@ulleo
ulleo deleted the fix/1409-embedded-datasource-chat branch October 26, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Embedded page with busiFlag:'ds' freezes browser when clicking "开始问数" (infinite redirect loop)

1 participant