Skip to content

fix: scope chat resume to current app#6860

Open
xqvvu wants to merge 2 commits intomainfrom
fix/resume-switch-app-main
Open

fix: scope chat resume to current app#6860
xqvvu wants to merge 2 commits intomainfrom
fix/resume-switch-app-main

Conversation

@xqvvu
Copy link
Copy Markdown
Collaborator

@xqvvu xqvvu commented Apr 29, 2026

Summary

  • Abort stale resume streams when switching apps or chats.
  • Gate auto-resume until the loaded chat init state matches the current app/chat route.
  • Reset app/chat scoped providers and avoid replaying resume catchup onto stale partial AI content.

Test plan

  • Confirmed switching apps during generation aborts the previous resume request.
  • Confirmed the new app only resumes after its own init state is ready.
  • Ran targeted ESLint through pre-commit hooks.

Made with Cursor

Abort stale resume streams when switching apps and only resume after the current app/chat init state is aligned.

Made-with: Cursor
@xqvvu xqvvu marked this pull request as ready for review April 29, 2026 10:01
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Coverage Report for global

Status Category Percentage Covered / Total
🔵 Lines 93.05% 2265 / 2434
🔵 Statements 92.82% 2471 / 2662
🔵 Functions 95.11% 428 / 450
🔵 Branches 88.79% 1656 / 1865
File CoverageNo changed files found.
Generated in workflow #677 for commit 539f37f by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Coverage Report for service

Status Category Percentage Covered / Total
🔵 Lines 32.82% 4161 / 12678
🔵 Statements 32.5% 4396 / 13523
🔵 Functions 27.92% 733 / 2625
🔵 Branches 28.2% 2299 / 8152
File CoverageNo changed files found.
Generated in workflow #677 for commit 539f37f by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Coverage Report for app

Status Category Percentage Covered / Total
🔵 Lines 5.99% 1721 / 28721
🔵 Statements 5.81% 1843 / 31712
🔵 Functions 3.51% 348 / 9903
🔵 Branches 4.47% 924 / 20652
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx 2.58% 0.33% 0.53% 2.81% 76, 77, 78, 79, 80, 81, 82, 83, 84, 95, 99-111, 147-1990, 2001-2004
projects/app/src/pageComponents/chat/ChatWindow/AppChatWindow.tsx 0% 0% 0% 0% 31-190
projects/app/src/pageComponents/chat/ChatWindow/HomeChatWindow.tsx 0% 0% 0% 0% 49-484
projects/app/src/web/common/api/fetch.ts 1.65% 0% 0% 1.7% 58-560, 571-632, 644-654, 668-678
Generated in workflow #677 for commit 539f37f by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_539f37f1b286e3d00d7ac99bc7c08495c1c17f97

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Build Successful - Preview code-sandbox Image for this PR:

ghcr.io/labring/fastgpt-pr:code-sandbox_539f37f1b286e3d00d7ac99bc7c08495c1c17f97

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Build Successful - Preview mcp_server Image for this PR:

ghcr.io/labring/fastgpt-pr:mcp_server_539f37f1b286e3d00d7ac99bc7c08495c1c17f97

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Apr 29, 2026
@xqvvu xqvvu marked this pull request as draft April 29, 2026 10:50
Ensure only one resume stream is active per client tab and discard queued resume messages after abort.

Made-with: Cursor
@xqvvu xqvvu force-pushed the fix/resume-switch-app-main branch from f9921a2 to 539f37f Compare April 29, 2026 10:51
@xqvvu xqvvu marked this pull request as ready for review April 29, 2026 10:52
@github-actions
Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 14.09% 1139 / 8081
🔵 Statements 14.08% 1194 / 8475
🔵 Functions 12.57% 245 / 1948
🔵 Branches 12.07% 536 / 4438
File CoverageNo changed files found.
Generated in workflow #29 for commit 539f37f by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_539f37f1b286e3d00d7ac99bc7c08495c1c17f97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant