mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
fix(server): abort behavior in sse stream (#12211)
fix AI-121 fix AI-118 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of connection closures and request abortion for streaming and non-streaming chat endpoints, ensuring session data is saved appropriately even if the connection is interrupted. - **Refactor** - Streamlined internal logic for managing request signals and connection events, resulting in more robust and explicit session management during streaming interactions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -36,6 +36,9 @@ test.describe('AIAction/GenerateAnImageWithImage', () => {
|
||||
await expect(answer.getByTestId('ai-answer-image')).toBeVisible();
|
||||
const insert = answer.getByTestId('answer-insert-below');
|
||||
await insert.click();
|
||||
await page.waitForSelector('.affine-image-container');
|
||||
await page.reload();
|
||||
|
||||
await utils.chatPanel.waitForHistory(page, [
|
||||
{
|
||||
role: 'action',
|
||||
|
||||
@@ -71,11 +71,15 @@ test.describe('AIAction/GenerateAnImageWithText', () => {
|
||||
const { answer } = await generateImage();
|
||||
const insert = answer.getByTestId('answer-insert-below');
|
||||
await insert.click();
|
||||
await page.waitForSelector('.affine-image-container');
|
||||
await page.reload();
|
||||
|
||||
await utils.chatPanel.waitForHistory(page, [
|
||||
{
|
||||
role: 'action',
|
||||
},
|
||||
]);
|
||||
|
||||
const { answer: panelAnswer, actionName } =
|
||||
await utils.chatPanel.getLatestAIActionMessage(page);
|
||||
await expect(
|
||||
|
||||
Reference in New Issue
Block a user