From 61c566e585e4e6736159351eb87e2d9cbb71597c Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Sat, 6 Dec 2025 03:56:18 +0100 Subject: [PATCH] [bugfix] Fix Load Image (from Outputs) node failing on macOS Filter out .DS_Store and placeholder files from remote widget file lists. On macOS, the .DS_Store file (a hidden system file created by Finder) was being included in the output folder file list. When the "Load Image (from Outputs)" node refreshed, it would select .DS_Store as the first file, causing the image preview to fail with an error since .DS_Store is not a valid image file. This fix filters out .DS_Store and the _output_images_will_be_put_here placeholder file from file lists returned by remote widget API calls. --- .../widgets/composables/useRemoteWidget.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.ts b/src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.ts index 765572752..9032f6d18 100644 --- a/src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.ts +++ b/src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.ts @@ -65,6 +65,19 @@ const isBackingOff = (entry: CacheEntry | undefined) => entry?.lastErrorTime && Date.now() - entry.lastErrorTime < getBackoff(entry.retryCount || 0) +// Filter out invalid files like .DS_Store +const filterFileList = (data: T): T => { + if (!Array.isArray(data)) return data + return data.filter((item) => { + if (typeof item !== 'string') return true + const basename = item.split('/').pop() ?? '' + if (['_output_images_will_be_put_here', '.DS_Store'].includes(basename)) { + return false + } + return true + }) as T +} + const fetchData = async ( config: RemoteWidgetConfig, controller: AbortController @@ -80,7 +93,8 @@ const fetchData = async ( ...authHeaders }) - return response_key ? res.data[response_key] : res.data + const data = response_key ? res.data[response_key] : res.data + return filterFileList(data) } export function useRemoteWidget<