mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(editor): Fix phantom items for waiting nodes (no-changelog) (#15410)
This commit is contained in:
@@ -659,6 +659,56 @@ describe('useWorkflowsStore', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should replace placeholder task data in waiting nodes correctly', () => {
|
||||||
|
const runWithExistingRunData = deepCopy(executionResponse);
|
||||||
|
runWithExistingRunData.data = {
|
||||||
|
resultData: {
|
||||||
|
runData: {
|
||||||
|
[successEvent.nodeName]: [
|
||||||
|
{
|
||||||
|
hints: [],
|
||||||
|
startTime: 1727867966633,
|
||||||
|
executionIndex: 2,
|
||||||
|
executionTime: 1,
|
||||||
|
source: [],
|
||||||
|
executionStatus: 'waiting',
|
||||||
|
data: {
|
||||||
|
main: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
json: {},
|
||||||
|
pairedItem: {
|
||||||
|
item: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
workflowsStore.setWorkflowExecutionData(runWithExistingRunData);
|
||||||
|
|
||||||
|
workflowsStore.nodesByName[successEvent.nodeName] = mock<INodeUi>({
|
||||||
|
type: 'n8n-nodes-base.manualTrigger',
|
||||||
|
});
|
||||||
|
|
||||||
|
// ACT
|
||||||
|
workflowsStore.updateNodeExecutionData(successEvent);
|
||||||
|
|
||||||
|
expect(workflowsStore.workflowExecutionData).toEqual({
|
||||||
|
...runWithExistingRunData,
|
||||||
|
data: {
|
||||||
|
resultData: {
|
||||||
|
runData: {
|
||||||
|
[successEvent.nodeName]: [successEvent.data],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
it('should replace existing placeholder task data in new log view', () => {
|
it('should replace existing placeholder task data in new log view', () => {
|
||||||
settingsStore.settings = {
|
settingsStore.settings = {
|
||||||
logsView: {
|
logsView: {
|
||||||
|
|||||||
@@ -1567,7 +1567,11 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
|
|||||||
const existingRunIndex = tasksData.findIndex(
|
const existingRunIndex = tasksData.findIndex(
|
||||||
(item) => item.executionIndex === data.executionIndex,
|
(item) => item.executionIndex === data.executionIndex,
|
||||||
);
|
);
|
||||||
const index = existingRunIndex > -1 ? existingRunIndex : tasksData.length - 1;
|
|
||||||
|
// For waiting nodes always replace the last item as executionIndex will always be different
|
||||||
|
const hasWaitingItems = tasksData.some((it) => it.executionStatus === 'waiting');
|
||||||
|
const index =
|
||||||
|
existingRunIndex > -1 && !hasWaitingItems ? existingRunIndex : tasksData.length - 1;
|
||||||
const status = tasksData[index]?.executionStatus ?? 'unknown';
|
const status = tasksData[index]?.executionStatus ?? 'unknown';
|
||||||
|
|
||||||
if ('waiting' === status || (settingsStore.isNewLogsEnabled && 'running' === status)) {
|
if ('waiting' === status || (settingsStore.isNewLogsEnabled && 'running' === status)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user