Skip to content

fix(export): keep zips written to --zip-dest-dir out of backend.zip - #8042

Merged
FarhanAliRaza merged 5 commits into
reflex-dev:mainfrom
ShaanGS:fix/export-zip-dest-dir
Dec 1, 2026
Merged

FarhanAliRaza merged 5 commits into
reflex-dev:mainfrom
ShaanGS:fix/export-zip-dest-dir

Conversation

@ShaanGS

@ShaanGS ShaanGS commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Description

Exporting to a folder inside the app puts frontend.zip in backend.zip, and a second export there makes backend.zip archive itself:

$ reflex init --template blank
$ mkdir dist
$ reflex export --zip-dest-dir dist
$ unzip -l dist/backend.zip | grep zip
Archive:  dist/backend.zip
   667646  11-26-2026 23:35   dist/frontend.zip
$ reflex export --zip-dest-dir dist

I stopped the second export after 20 s, at 525 MB. It keeps going until the disk is full. Without the mkdir, the export fails at the end with a FileNotFoundError for dist/frontend.zip. 0.11.0 behaves the same.

zip_app only left out the zips in the current directory. It now also leaves out the ones in zip_dest_dir, by file identity like the rest of the walk, and creates that folder if it's missing. The .web/backend files were checked by name against a set of paths, which never matched, so they get the same check, and --exclude-from-backend now works for them.

I didn't skip every zip in the app: old zips in dist/ still go into an export to out/, like any other file.

Without the fix, 7 of the new test cases fail. A plain reflex export writes byte-identical zips with and without it.

View guided diff

When --zip-dest-dir points inside the app, backend.zip archived the
frontend.zip just written there, and on a second export it archived
itself while being written, growing until the disk filled up. Exclude
the zips in zip_dest_dir as well as the ones in the app directory, and
create zip_dest_dir when it is missing instead of crashing.

The .web/backend files added by glob were checked by name against a
set of paths, which never matched, so they get the same identity check
as the rest of the walk.
@ShaanGS
ShaanGS requested a review from a team as a code owner November 27, 2026 17:53
@FarhanAliRaza FarhanAliRaza added the bug Something isn't working label Nov 27, 2026 — with ChatGPT Codex Connector
@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable issues remain.

Summary

Keeps archives written to --zip-dest-dir out of backend.zip.

  • Exports keep their output zip files out of backend.zip.
  • Backend exclusions also remove matching files from .web/backend.

No new actionable issues found. The previously reported helper docstring is now present. Tests were not run during this review.

Reviews (4) · Last reviewed commit: "Check for an empty exclusion set inside ..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread tests/units/utils/test_build.py Resolved
@codspeed

codspeed Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 15 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 146 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing ShaanGS:fix/export-zip-dest-dir (f7b29ba) with main (8e0e881)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment thread tests/units/utils/test_build.py Resolved
Also document the test helper that builds the exportable app.
@FarhanAliRaza FarhanAliRaza added the priority: P1 High: confirmed bug with repro in a common feature, or high demand label Nov 30, 2026 — with Claude
@FarhanAliRaza FarhanAliRaza added the on deck PRs lined up to review / merge next label Dec 1, 2026
The directory walk skipped the identity stat when nothing was excluded, but
the .web/backend glob did not. Move the check into the helper so all three
callers behave the same.
@FarhanAliRaza
FarhanAliRaza merged commit ee44782 into reflex-dev:main Dec 1, 2026
170 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working on deck PRs lined up to review / merge next priority: P1 High: confirmed bug with repro in a common feature, or high demand

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants