Skip to content

fix(apps): bring a result saved in a subfolder to the app page on Windows - #2165

Queued
alexisrolland wants to merge 1 commit into
mainfrom
alexis/apps-windows-subfolder
Queued

alexisrolland wants to merge 1 commit into
mainfrom
alexis/apps-windows-subfolder

Conversation

@alexisrolland

Copy link
Copy Markdown
Member

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 SaveImage runs the filename prefix through os.path.normpath. A prefix of apps/remove-background/cutout comes 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 /view check refused any backslash in subfolder, so the request got a 403. The page gave up after three tries. Every app saves into apps/<app>/, so all of them are affected on Windows.

Fix

readLocalCall now accepts either separator in subfolder and 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 /view keeps its path checks.

Verification

  • Ran a SaveImage into apps/probe/ on a real Windows ComfyUI (Nightly) and checked Desktop's readLocalCall and outputFilesOf against its history. Before the fix, the page's /view request was refused, which means a 403. After the fix, it matched the run's own file and /view answered 200 with the PNG.
  • Added unit tests: a backslash subfolder is read, and ..\..\user and apps\../.. are refused. localCalls and localComfy tests pass.

…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>
@alexisrolland
alexisrolland requested review from a team as code owners November 16, 2026 22:29
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The /view subfolder check now permits backslashes and detects .. segments separated by either slash style. Tests cover accepted backslash paths and refused traversal paths.

Changes: Local-call subfolder validation

Layer / File(s) Summary
Subfolder parsing and traversal checks
src/main/apps/localCalls.ts, src/main/apps/localCalls.test.ts
The subfolder pattern permits backslashes while retaining its NUL and length restrictions. Traversal checks detect .. segments separated by / or \. Tests cover an accepted backslash path and refused traversal cases.

Possibly related PRs

Suggested reviewers: benceruleanlu, deepme987

Merge Risk: Minimal · up to 5bf36

This fixes app results saved in subfolders failing to appear on Windows because of backslash separators. Traversal steps are still refused, and no concrete merge-blocking risk was found.

Pre-merge checks: Passed 2

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 810f0911-eae8-4988-bbf1-f5354bfeebd0
Commits

Reviewing files that changed from the base of the PR and between 7527125 and 5bf36fd.

Files selected for processing: 2

  • src/main/apps/localCalls.test.ts
  • src/main/apps/localCalls.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@vqt123

vqt123 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Starting review at 5bf36fd.

@vqt123

vqt123 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Approving at 5bf36fd.

Clean: Correctness, Resilience, Access, Words, Contract, Vendor, Rollout, Rules, Cause.

Not covered: Access/Contract - browser Apps journey: pnpm exec playwright test e2e/apps-local.test.ts --project=windows. Vendor/Correctness - native Windows retrieval: run an app using This computer and confirm its history-listed backslash subfolder returns the saved image through /view; the existing browser fixture uses apps.

Checked: Read, not run: Windows subfolder acceptance and parent-step rejection against the merge base (src/main/apps/localCalls.ts:9, :52); history-file ownership and forwarding (src/main/apps/localComfy.ts:438, :467); ComfyUI's subfolder production and containment checks (folder_paths.py:556, server.py:638).

~593k effective tokens for this review (2.6M raw; cache reads weighted 0.1x, cache writes 1.25-2x)

@alexisrolland
alexisrolland added this pull request to the merge queue Nov 16, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants