René's URL Explorer Experiment


Title: fix(microsoft-word): make conditional writes service-enforced and return 400 for bad input by waleedlatif1 · Pull Request #7094 · simstudioai/sim · GitHub

Open Graph Title: fix(microsoft-word): make conditional writes service-enforced and return 400 for bad input by waleedlatif1 · Pull Request #7094 · simstudioai/sim

X Title: fix(microsoft-word): make conditional writes service-enforced and return 400 for bad input by waleedlatif1 · Pull Request #7094 · simstudioai/sim

Description: Summary Follow-ups to the Microsoft Word integration, from review comments left on the v0.8.12 release PR Replaces the client-side freshness re-read with a service-enforced precondition, and stops three caller-input mistakes from being reported as 500s Conditional writes are now service-enforced PUT /items/{id}/content documents no precondition — its request-headers table lists only Authorization and Content-Type — so the previous guard re-read the item and compared cTag client-side, then sent a best-effort if-match. The review was right that a separate re-read cannot deliver the guarantee. createUploadSession does document if-match, returning 412 Precondition Failed on a mismatch. Append and Find-and-Replace now write through it: POST {item}/createUploadSession with if-match: — the service rejects a stale edit with a 412, surfaced as a 409 PUT the bytes to the returned preauthenticated uploadUrl, without the bearer token (Graph documents that sending Authorization there can fail with a 401) The separate re-read is gone. The residual window is stated honestly in the code: the tag is evaluated at session creation and the bytes commit on the next request. Closing it completely needs the deferred-commit form, whose conditional commit relies on @microsoft.graph.sourceUrl — documented as unsupported on OneDrive for Business and SharePoint Online, which is where these documents live. Create and Create-from-Template keep the plain PUT: they make new files and already pin @microsoft.graph.conflictBehavior=rename. Replace Content also keeps it — overwriting is its stated contract. Caller input no longer returns 500 ensureDocxExtension and the path-builders validate Graph's rules after contract parsing, and threw plain Errors that the route's error projection reported as 500s. They now throw a typed MicrosoftWordInputError carrying a 400, so a malformed document/folder/drive ID or a whitespace-only name reads as the client mistake it is. An empty placeholder key is rejected at the contract instead, in both the object and JSON-string forms — a blank placeholder would match at every position in the document, and previously failed mid-rewrite as a 500. Type of Change Bug fix (non-breaking change which fixes an issue) Testing 45 tests across the Word suites, 7 of them new: the session flow asserts if-match on the session POST and that the bytes PUT carries no Authorization; a 412 at either step maps to 409; malformed IDs, a blank name, and empty placeholder keys all return 400 with no request issued Mutation-checked: reverting each of the three guards turns its tests red (7 failures) bun run check:audits 33/33, type-check, lint:check, docs-manifest:check, check:migrations all clean Not exercised against a live Microsoft tenant — the upload-session flow follows the documented request/response shapes, and no undocumented response field is relied on 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: Summary Follow-ups to the Microsoft Word integration, from review comments left on the v0.8.12 release PR Replaces the client-side freshness re-read with a service-enforced precondition, and stops...

X Description: Summary Follow-ups to the Microsoft Word integration, from review comments left on the v0.8.12 release PR Replaces the client-side freshness re-read with a service-enforced precondition, and stops...

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

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:0e79619e-0689-b309-65a8-d683975a225e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA82E:23725B:C4A43F:10E11B9:6AFB545D
html-safe-nonce428a884f7d49c03fb3e13bccb7ad6985f5f9c73d2e01f9ce40585774e7c8d5a9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODJFOjIzNzI1QjpDNEE0M0Y6MTBFMTFCOTo2QUZCNTQ1RCIsInZpc2l0b3JfaWQiOiIyMjI1NzMwODQ1NzU3MTAxMTQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac44fec3fc24e77ae95ab683302bc1ecfdbf2a7ea386fc3c2d91dfdc0d8dce0e6a
hovercard-subject-tagpull_request:4363525061
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/7094/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:altSummary Follow-ups to the Microsoft Word integration, from review comments left on the v0.8.12 release PR Replaces the client-side freshness re-read with a service-enforced precondition, and stops...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
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
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7094/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7094%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%2F7094%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/7094/files
Reloadhttps://github.com/simstudioai/sim/pull/7094/files
Reloadhttps://github.com/simstudioai/sim/pull/7094/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
review/pr-7090-followupshttps://github.com/simstudioai/sim/tree/review/pr-7090-followups
Conversation 5 https://github.com/simstudioai/sim/pull/7094
Commits 2 https://github.com/simstudioai/sim/pull/7094/commits
Checks 29 https://github.com/simstudioai/sim/pull/7094/checks
Files changed https://github.com/simstudioai/sim/pull/7094/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7094/files
fix(microsoft-word): make conditional writes service-enforced and return 400 for bad input https://github.com/simstudioai/sim/pull/7094/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/7094/files
1a3bead fix(microsoft-word): make conditional writes service-enforced and ret… waleedlatif1 Aug 26, 2026 https://github.com/simstudioai/sim/pull/7094/commits/1a3beadba085e2714412fcaf0a11881c5707f05e
a312ec3 fix(microsoft-word): split large document uploads into sequential fra… waleedlatif1 Aug 26, 2026 https://github.com/simstudioai/sim/pull/7094/commits/a312ec3ebe30cb4626a47ed928c2311796a25519
Clear filters https://github.com/simstudioai/sim/pull/7094/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7094/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7094/files
route.test.ts https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
route.ts https://github.com/simstudioai/sim/pull/7094/files#diff-4df70e556dce46a9b596a585a57882b0942ac3ef4617c0a8c2dcc842814d4e57
route.test.ts https://github.com/simstudioai/sim/pull/7094/files#diff-bee4e146275ffac4c643db56743416c6b4f94171dffb0e0c78d5933fef6f384f
route.test.ts https://github.com/simstudioai/sim/pull/7094/files#diff-838f6b18579d8f66fd2138c8221da23b9a2bd8c375e6e257c0b388ec792593c9
route.ts https://github.com/simstudioai/sim/pull/7094/files#diff-2b42af403b0ed7c93e27f90b91b8d80847404c9ac490e1659986736a8c61423b
utils.ts https://github.com/simstudioai/sim/pull/7094/files#diff-84d9d12e9a6baa3bc65469c0cbc43c65a9786d3ab9d7ee89bb529e69099eef29
microsoft.ts https://github.com/simstudioai/sim/pull/7094/files#diff-6324a4eafb1b3eb055cc04585f4a2c509147f61cf1680aaea3ea97dec4043186
graph.server.test.ts https://github.com/simstudioai/sim/pull/7094/files#diff-7081173a4de343dc140e4b7ab9f3d6af619dee605ad339c96da6333249a96081
graph.server.ts https://github.com/simstudioai/sim/pull/7094/files#diff-7e9a1a5165d06f5b1c6e1487bd2d7f33f94ab70e90d4bcf40e8defd31780ca92
errors.ts https://github.com/simstudioai/sim/pull/7094/files#diff-57374502913c228abced38b5daf7e5ee16d8ffe945c1c1f18afd187a75a99948
utils.ts https://github.com/simstudioai/sim/pull/7094/files#diff-eeb95acd6b505d31857b686d69f860856a8607f920428772c01b8211feb66ebe
apps/sim/app/api/tools/microsoft_word/append/route.test.tshttps://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
View file https://github.com/simstudioai/sim/blob/a312ec3ebe30cb4626a47ed928c2311796a25519/apps/sim/app/api/tools/microsoft_word/append/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7094/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
https://github.com/simstudioai/sim/pull/7094/files#diff-f3f2a613bc35fd64ae2a20cc34d08816d6678d795f8004fafc46df668d8003ca
apps/sim/app/api/tools/microsoft_word/append/route.tshttps://github.com/simstudioai/sim/pull/7094/files#diff-4df70e556dce46a9b596a585a57882b0942ac3ef4617c0a8c2dcc842814d4e57
View file https://github.com/simstudioai/sim/blob/a312ec3ebe30cb4626a47ed928c2311796a25519/apps/sim/app/api/tools/microsoft_word/append/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7094/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7094/files#diff-4df70e556dce46a9b596a585a57882b0942ac3ef4617c0a8c2dcc842814d4e57
https://github.com/simstudioai/sim/pull/7094/files#diff-4df70e556dce46a9b596a585a57882b0942ac3ef4617c0a8c2dcc842814d4e57
https://github.com/simstudioai/sim/pull/7094/files#diff-4df70e556dce46a9b596a585a57882b0942ac3ef4617c0a8c2dcc842814d4e57
https://github.com/simstudioai/sim/pull/7094/files#diff-4df70e556dce46a9b596a585a57882b0942ac3ef4617c0a8c2dcc842814d4e57
apps/sim/app/api/tools/microsoft_word/create-from-template/route.test.tshttps://github.com/simstudioai/sim/pull/7094/files#diff-bee4e146275ffac4c643db56743416c6b4f94171dffb0e0c78d5933fef6f384f
View file https://github.com/simstudioai/sim/blob/a312ec3ebe30cb4626a47ed928c2311796a25519/apps/sim/app/api/tools/microsoft_word/create-from-template/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7094/{{ revealButtonHref }}
apps/sim/app/api/tools/microsoft_word/create/route.test.tshttps://github.com/simstudioai/sim/pull/7094/files#diff-838f6b18579d8f66fd2138c8221da23b9a2bd8c375e6e257c0b388ec792593c9
View file https://github.com/simstudioai/sim/blob/a312ec3ebe30cb4626a47ed928c2311796a25519/apps/sim/app/api/tools/microsoft_word/create/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7094/{{ revealButtonHref }}
apps/sim/app/api/tools/microsoft_word/replace-text/route.tshttps://github.com/simstudioai/sim/pull/7094/files#diff-2b42af403b0ed7c93e27f90b91b8d80847404c9ac490e1659986736a8c61423b
View file https://github.com/simstudioai/sim/blob/a312ec3ebe30cb4626a47ed928c2311796a25519/apps/sim/app/api/tools/microsoft_word/replace-text/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7094/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7094/files#diff-2b42af403b0ed7c93e27f90b91b8d80847404c9ac490e1659986736a8c61423b
https://github.com/simstudioai/sim/pull/7094/files#diff-2b42af403b0ed7c93e27f90b91b8d80847404c9ac490e1659986736a8c61423b
https://github.com/simstudioai/sim/pull/7094/files#diff-2b42af403b0ed7c93e27f90b91b8d80847404c9ac490e1659986736a8c61423b
https://github.com/simstudioai/sim/pull/7094/files#diff-2b42af403b0ed7c93e27f90b91b8d80847404c9ac490e1659986736a8c61423b
apps/sim/app/api/tools/microsoft_word/utils.tshttps://github.com/simstudioai/sim/pull/7094/files#diff-84d9d12e9a6baa3bc65469c0cbc43c65a9786d3ab9d7ee89bb529e69099eef29
View file https://github.com/simstudioai/sim/blob/a312ec3ebe30cb4626a47ed928c2311796a25519/apps/sim/app/api/tools/microsoft_word/utils.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7094/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7094/files#diff-84d9d12e9a6baa3bc65469c0cbc43c65a9786d3ab9d7ee89bb529e69099eef29
https://github.com/simstudioai/sim/pull/7094/files#diff-84d9d12e9a6baa3bc65469c0cbc43c65a9786d3ab9d7ee89bb529e69099eef29
apps/sim/lib/api/contracts/tools/microsoft.tshttps://github.com/simstudioai/sim/pull/7094/files#diff-6324a4eafb1b3eb055cc04585f4a2c509147f61cf1680aaea3ea97dec4043186
View file https://github.com/simstudioai/sim/blob/a312ec3ebe30cb4626a47ed928c2311796a25519/apps/sim/lib/api/contracts/tools/microsoft.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7094/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7094/files#diff-6324a4eafb1b3eb055cc04585f4a2c509147f61cf1680aaea3ea97dec4043186
https://github.com/simstudioai/sim/pull/7094/files#diff-6324a4eafb1b3eb055cc04585f4a2c509147f61cf1680aaea3ea97dec4043186
https://github.com/simstudioai/sim/pull/7094/files#diff-6324a4eafb1b3eb055cc04585f4a2c509147f61cf1680aaea3ea97dec4043186
Please reload this pagehttps://github.com/simstudioai/sim/pull/7094/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7094/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.