René's URL Explorer Experiment


Title: fix(files): archive rendered document bytes instead of generator source by waleedlatif1 · Pull Request #5986 · simstudioai/sim · GitHub

Open Graph Title: fix(files): archive rendered document bytes instead of generator source by waleedlatif1 · Pull Request #5986 · simstudioai/sim

X Title: fix(files): archive rendered document bytes instead of generator source by waleedlatif1 · Pull Request #5986 · simstudioai/sim

Description: Follow-up to #5985 (same two archive surfaces, different bug). Summary Generated docs (docx/pptx/pdf/xlsx) store their generation source as the primary file; the rendered binary lives in a separate content-addressed artifact store. resolveServableDocBytes is the shared chokepoint that swaps one for the other — its own doc comment calls a raw read "the corruption every non-serve consumer used to ship" The serve route, single-file download, /api/files/export, and ~50 tool routes already go through it. The bulk zip route and file_compress did not, so every generated document landed in the archive as JavaScript source text named *.docx — Word reports it as corrupt Both surfaces now resolve through downloadServableFileFromStorage Bulk zip resolves with bounded concurrency (mapWithConcurrency) instead of an unbounded Promise.all The size cap is re-checked against the rendered bytes: the pre-download check uses the declared source size, and a small generator script can render to a much larger document. The audit log now records the delivered byte count too A document whose artifact is still compiling returns 409 naming the specific files, matching the existing single-file behavior — never a silent drop, never source bytes in the zip Type of Change Bug fix Testing New route tests cover four paths: rendered bytes land in the zip (not the stored source), 409 names only the still-compiling documents, the rendered-size cap rejects, and a storage failure surfaces as 500 rather than an archive with an empty entry. 358 tests pass across lib/uploads, tools/file, and app/api/tools. Typecheck, lint, and check:api-validation clean. Not covered here: /api/v1/files/[fileId] (public API) has the same raw-bytes bug. Left out to keep this focused — changing public API response bytes deserves its own call. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Follow-up to #5985 (same two archive surfaces, different bug). Summary Generated docs (docx/pptx/pdf/xlsx) store their generation source as the primary file; the rendered binary lives in a separat...

X Description: Follow-up to #5985 (same two archive surfaces, different bug). Summary Generated docs (docx/pptx/pdf/xlsx) store their generation source as the primary file; the rendered binary lives in a separat...

Opengraph URL: https://github.com/simstudioai/sim/pull/5986

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2731546a-b5b9-411e-2b7f-aa563abf5584
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD086:1BC3DC:7F9707:B47E08:6AFB4D74
html-safe-nonce3a81e5874ec7762b39a74a928363db0fa7e1bd1d9b25e3b764c49196be0ec097
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDg2OjFCQzNEQzo3Rjk3MDc6QjQ3RTA4OjZBRkI0RDc0IiwidmlzaXRvcl9pZCI6IjgyNDM1NzAyNDYxNTM4ODI5OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac70b72c2f7cd7ecf91227ac6c3944342a2538fcc10f81aa6acec125aeb0b82bcc
hovercard-subject-tagpull_request:4146507073
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5986/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altFollow-up to #5985 (same two archive surfaces, different bug). Summary Generated docs (docx/pptx/pdf/xlsx) store their generation source as the primary file; the rendered binary lives in a separat...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneacf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26504db649b58525278f77a52b80ba5f10d5f4de
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5986/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5986%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5986%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5986/files
Reloadhttps://github.com/simstudioai/sim/pull/5986/files
Reloadhttps://github.com/simstudioai/sim/pull/5986/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/archive-generated-doc-byteshttps://github.com/simstudioai/sim/tree/fix/archive-generated-doc-bytes
Conversation 69 https://github.com/simstudioai/sim/pull/5986
Commits 12 https://github.com/simstudioai/sim/pull/5986/commits
Checks 19 https://github.com/simstudioai/sim/pull/5986/checks
Files changed https://github.com/simstudioai/sim/pull/5986/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5986/files
fix(files): archive rendered document bytes instead of generator source https://github.com/simstudioai/sim/pull/5986/files#top
Show all changes 12 commits https://github.com/simstudioai/sim/pull/5986/files
68ffafb fix(files): archive rendered document bytes instead of generator source waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/68ffafb263f5661763153de8378531f1a7787106
9da5816 improvement(files): centralize servable-byte reads and bound the zip … waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/9da5816097f5968a9082b1662b5ab150f4f36ffc
81a7e92 improvement(files): bound rendered documents with a per-entry byte ce… waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/81a7e92535050d1870d1449ee91c605e11829ea6
84d174b fix(files): keep size and cancellation outcomes distinct across archi… waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/84d174be81f5ef36ba57a29bb473c1ecc0078554
257abfe fix(files): size the per-entry allowance off the declared size waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/257abfee7efde8012641908442a9890dd5abe572
d9b9a30 fix(files): record a size rejection even when another read aborted first waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/d9b9a3047f3f945a451cfe3dae5741bc262ad5e8
396ef43 fix(files): name the entry that exceeds the per-document render cap waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/396ef43f2776c957df43051ceedca233ba4ea1d6
8a02ca6 fix(files): return a retryable 409 from the v1 download for compiling… waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/8a02ca665de63c1c6137b9a230bfc40e1c46d6a8
339b648 fix(files): attribute a size rejection to the cap that actually bound it waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/339b648b886477dbfc91caf733d6f59aba2e998f
78f322f improvement(files): surface archive download errors in place waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/78f322fc0be7794f420cc283764e727bd3ed1e8e
003e75c fix(files): blame the entry when its cap ties the remaining budget waleedlatif1 Jul 27, 2026 https://github.com/simstudioai/sim/pull/5986/commits/003e75cb0452a6d05715f7a672c9edcbac8b990a
95942d2 fix(files): read renderable documents one at a time to remove the mem… waleedlatif1 Jul 28, 2026 https://github.com/simstudioai/sim/pull/5986/commits/95942d29a4381f3df4c49c3f7cd79fa442f6ab59
Clear filters https://github.com/simstudioai/sim/pull/5986/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5986/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5986/files
route.ts https://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
route.ts https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
route.test.ts https://github.com/simstudioai/sim/pull/5986/files#diff-21e96ed9826e90b7329c0f1d4f3cc50878206832cf2989952c81b8bc82adb9c5
route.ts https://github.com/simstudioai/sim/pull/5986/files#diff-9409e139d8dc3ad2d247da0545d04306516702ec8fab78b87b3b2eff1186f4f3
files.tsx https://github.com/simstudioai/sim/pull/5986/files#diff-0284e2e46ba0636bd37fb01a0bee2a53844af9bbaf0a5879e3b182c0f34e67a9
download.ts https://github.com/simstudioai/sim/pull/5986/files#diff-792c5cfd9d600277ea52e08970dfec8b42adb5439e7ee10c47b19e01f741aa70
workspace-file-manager.ts https://github.com/simstudioai/sim/pull/5986/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
file-utils.server.ts https://github.com/simstudioai/sim/pull/5986/files#diff-56073f04957682936465d04d9660e33d45b8f6151b8ce0947b9cfd6ad3e3533e
file-utils.ts https://github.com/simstudioai/sim/pull/5986/files#diff-ffb723db3f5688d79b0407b2238a775980249044a6ab20e212e0297a248b71e3
servable-file-response.ts https://github.com/simstudioai/sim/pull/5986/files#diff-90f7b005d92dd50db6f68c8b09ea0295cc368be115ebfd9ac5ac631f20253c84
apps/sim/app/api/tools/file/manage/route.tshttps://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
View file https://github.com/simstudioai/sim/blob/95942d29a4381f3df4c49c3f7cd79fa442f6ab59/apps/sim/app/api/tools/file/manage/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5986/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
https://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
https://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
Please reload this pagehttps://github.com/simstudioai/sim/pull/5986/files
https://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
https://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
https://github.com/simstudioai/sim/pull/5986/files#diff-d83cb3ae7797f37be74e772050f9816866e6c2588e054c84190902bce990e376
apps/sim/app/api/v1/files/[fileId]/route.tshttps://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
View file https://github.com/simstudioai/sim/blob/95942d29a4381f3df4c49c3f7cd79fa442f6ab59/apps/sim/app/api/v1/files/%5BfileId%5D/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5986/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
https://github.com/simstudioai/sim/pull/5986/files#diff-e6b64afa5144ec6796154b004bc1322ddc9fcf82f9c4fc961ca13c3cc07ee4b0
apps/sim/app/api/workspaces/[id]/files/download/route.test.tshttps://github.com/simstudioai/sim/pull/5986/files#diff-21e96ed9826e90b7329c0f1d4f3cc50878206832cf2989952c81b8bc82adb9c5
View file https://github.com/simstudioai/sim/blob/95942d29a4381f3df4c49c3f7cd79fa442f6ab59/apps/sim/app/api/workspaces/%5Bid%5D/files/download/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5986/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/5986/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5986/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.