Repository navigation
fix(canvas): repair viewport and graph-load lifecycle defects from #11420 #19976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7e1d177
dfb4756
3652741
356ae52
ebe1fc6
582e3f2
2278cf2
d63d7f3
4f660aa
64d36ad
4e4adb2
8a9a0fa
5c02816
44455fc
c1d968b
60a260d
47623e6
67bf8b6
48296c6
7f13a44
8a7312c
9367246
42cdf9a
3c07d60
95b6702
f416d0b
8802da2
bc2dc75
060ce19
99dc256
0ee4f10
88f72b2
0e68d58
37559cc
86c6d31
d9f973d
7245b72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ import { webSocketFixture } from '@e2e/fixtures/ws' | |
|
|
||
| const wstest = mergeTests(test, webSocketFixture) | ||
|
|
||
| wstest.use({ initialSettings: { 'Comfy.Minimap.Visible': false } }) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3 question: Commit |
||
|
|
||
| wstest( | ||
| 'Seed handling', | ||
| { tag: '@vue-nodes' }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import { expect } from '@playwright/test' | ||
|
|
||
| import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema' | ||
|
|
||
| import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage' | ||
|
|
||
| function noteWorkflow(title: string): ComfyWorkflowJSON { | ||
| return { | ||
| last_node_id: 1, | ||
| last_link_id: 0, | ||
| nodes: [ | ||
| { | ||
| id: 1, | ||
| type: 'Note', | ||
| title, | ||
| pos: [120, 120], | ||
| size: [260, 120], | ||
| flags: {}, | ||
| order: 0, | ||
| mode: 0, | ||
| properties: {}, | ||
| widgets_values: [''] | ||
| } | ||
| ], | ||
| links: [], | ||
| groups: [], | ||
| config: {}, | ||
| extra: {}, | ||
| version: 0.4 | ||
| } | ||
| } | ||
|
|
||
| test.describe('Workflow load queue', { tag: '@vue-nodes' }, () => { | ||
| test('workflow loads finish in FIFO order', async ({ comfyPage }) => { | ||
| const { page, vueNodes } = comfyPage | ||
|
|
||
| const result = | ||
| await test.step('hold the first load open, then queue a second', async () => | ||
| await page.evaluate( | ||
| async ([older, newer]) => { | ||
| let release!: () => void | ||
| const held = new Promise<void>((resolve) => { | ||
| release = resolve | ||
| }) | ||
| let entered!: () => void | ||
| const firstEntered = new Promise<void>((resolve) => { | ||
| entered = resolve | ||
| }) | ||
| let holdNext = true | ||
| let beforeLoadGraphCalls = 0 | ||
| window.app!.registerExtension({ | ||
| name: 'e2e.stallBeforeLoadGraph', | ||
| beforeLoadGraph: async () => { | ||
| beforeLoadGraphCalls++ | ||
| if (!holdNext) return | ||
| holdNext = false | ||
| entered() | ||
| await held | ||
| } | ||
| }) | ||
|
|
||
| const order: string[] = [] | ||
| const olderLoad = window.app!.loadGraphData(older) | ||
| await firstEntered | ||
| const newerLoad = window | ||
| .app!.loadGraphData(newer) | ||
| .then(() => order.push('newer')) | ||
| await Promise.resolve() | ||
| const loadsStartedWhileOlderWasHeld = beforeLoadGraphCalls | ||
| release() | ||
| await olderLoad.then(() => order.push('older')) | ||
| await newerLoad | ||
| return { order, loadsStartedWhileOlderWasHeld } | ||
| }, | ||
| [ | ||
| noteWorkflow('older workflow'), | ||
| noteWorkflow('newer workflow') | ||
| ] as const | ||
| )) | ||
|
|
||
| expect(result).toEqual({ | ||
| order: ['older', 'newer'], | ||
| loadsStartedWhileOlderWasHeld: 1 | ||
| }) | ||
|
|
||
| await test.step('the canvas shows the last queued workflow', async () => { | ||
| await expect(vueNodes.nodes).toHaveCount(1) | ||
| await expect( | ||
| vueNodes.getNodeByTitle('newer workflow').first() | ||
| ).toBeVisible() | ||
| await expect(vueNodes.getNodeByTitle('older workflow')).toHaveCount(0) | ||
| }) | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 question:
nodeCount * 2assumed the canvas already heldworkflow1's graph whennodeCountwas read; this changes the oracle so it no longer does. The two only differ when the canvas holds some other graph at that point. Was a queued load still running when the count was taken? If so, the new expectation hides a readiness change instead of waiting for it. The commit that made the change is titled "stabilize" and doesn't say.