mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Minor streaming fixes (no-changelog) (#17683)
This commit is contained in:
@@ -513,7 +513,7 @@ describe('streaming functionality', () => {
|
||||
expect(mockHooks.addHandler).toHaveBeenCalledWith('sendChunk', expect.any(Function));
|
||||
});
|
||||
|
||||
it('should not setup sendChunk handler when streaming is enabled but execution mode is manual', async () => {
|
||||
it('should setup sendChunk handler when streaming is enabled and execution mode is manual', async () => {
|
||||
// ARRANGE
|
||||
const activeExecutions = Container.get(ActiveExecutions);
|
||||
jest.spyOn(activeExecutions, 'add').mockResolvedValue('1');
|
||||
@@ -550,6 +550,6 @@ describe('streaming functionality', () => {
|
||||
await runner.run(data);
|
||||
|
||||
// ASSERT
|
||||
expect(mockHooks.addHandler).not.toHaveBeenCalledWith('sendChunk', expect.any(Function));
|
||||
expect(mockHooks.addHandler).toHaveBeenCalledWith('sendChunk', expect.any(Function));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -268,12 +268,10 @@ export class WorkflowRunner {
|
||||
});
|
||||
|
||||
if (data.streamingEnabled) {
|
||||
if (data.executionMode !== 'manual') {
|
||||
lifecycleHooks.addHandler('sendChunk', (chunk) => {
|
||||
data.httpResponse?.write(JSON.stringify(chunk) + '\n');
|
||||
data.httpResponse?.flush?.();
|
||||
});
|
||||
}
|
||||
lifecycleHooks.addHandler('sendChunk', (chunk) => {
|
||||
data.httpResponse?.write(JSON.stringify(chunk) + '\n');
|
||||
data.httpResponse?.flush?.();
|
||||
});
|
||||
}
|
||||
|
||||
additionalData.setExecutionStatus = WorkflowExecuteAdditionalData.setExecutionStatus.bind({
|
||||
|
||||
Reference in New Issue
Block a user