Repository navigation
fix(apps): bring a result saved in a subfolder to the app page on Windows - #2165
alexisrolland wants to merge 1 commit into
Conversation
…dows ComfyUI on Windows names an output's subfolder with backslashes (apps\remove-background), because SaveImage runs the filename prefix through os.path.normpath. The app page sends that subfolder back on /view, and Desktop refused any backslash in it, so every app whose result lands in apps/<app>/ got a 403 and the page showed "Could not bring the result to this page". Accept either separator in the subfolder and keep refusing a .. step written with either one. Desktop still only forwards files from the history of a run the page started. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e658-c5f3-7362-86a2-13b490a4a4d3 Co-authored-by: Amp <amp@ampcode.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Starting review at 5bf36fd. |
|
Approving at 5bf36fd. Clean: Correctness, Resilience, Access, Words, Contract, Vendor, Rollout, Rules, Cause. Not covered: Access/Contract - browser Apps journey: Checked: Read, not run: Windows subfolder acceptance and parent-step rejection against the merge base ( ~593k effective tokens for this review (2.6M raw; cache reads weighted 0.1x, cache writes 1.25-2x) |
Problem
On Windows, every app run on This computer finishes, but the page fails at "Bringing it to this page" with "Could not bring the result to this page. It is saved in your ComfyUI output folder."
ComfyUI on Windows reports an output's subfolder with backslashes, because
SaveImageruns the filename prefix throughos.path.normpath. A prefix ofapps/remove-background/cutoutcomes back in history as:{ "filename": "cutout_00001_.png", "subfolder": "apps\\remove-background", "type": "output" }The app page sends that subfolder back on
/view. Desktop's/viewcheck refused any backslash insubfolder, so the request got a 403. The page gave up after three tries. Every app saves intoapps/<app>/, so all of them are affected on Windows.Fix
readLocalCallnow accepts either separator insubfolderand still refuses a..step written with either/or\. Desktop still forwards only files from the history of a run the page started, and ComfyUI's own/viewkeeps its path checks.Verification
SaveImageintoapps/probe/on a real Windows ComfyUI (Nightly) and checked Desktop'sreadLocalCallandoutputFilesOfagainst its history. Before the fix, the page's/viewrequest was refused, which means a 403. After the fix, it matched the run's own file and/viewanswered 200 with the PNG...\..\userandapps\../..are refused.localCallsandlocalComfytests pass.