mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
On failed subgraph resolution, return undefined (#6460)
Resolving an executionId to a locatorId can fail if the current workflow does not match the queued one. Rather than throwing an error, the resolution functions have been changed to return undefined. Of note, all consumers of these functions already had checks to ensure the returned value is not undefined. - Even the test for failure state already specified that it should return instead of throwing an error. This PR cleans up a frequent sentry error. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6460-On-failed-subgraph-resolution-return-undefined-29c6d73d365081c5860ed7d24a99414c) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -156,14 +156,11 @@ describe('useExecutionStore - NodeLocatorId conversions', () => {
|
||||
expect(result).toBe('123')
|
||||
})
|
||||
|
||||
it('should return null when conversion fails', () => {
|
||||
it('should return undefined when conversion fails', () => {
|
||||
// Mock app.graph.getNodeById to return null (node not found)
|
||||
vi.mocked(app.graph.getNodeById).mockReturnValue(null)
|
||||
|
||||
// This should throw an error as the node is not found
|
||||
expect(() => store.executionIdToNodeLocatorId('999:456')).toThrow(
|
||||
'Subgraph not found: 999'
|
||||
)
|
||||
expect(store.executionIdToNodeLocatorId('999:456')).toBe(undefined)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user