René's URL Explorer Experiment


Title: fmt: cached check passes while --no-cache fails after formatting · Issue #479 · rstackjs/rstack-cli · GitHub

Open Graph Title: fmt: cached check passes while --no-cache fails after formatting · Issue #479 · rstackjs/rstack-cli

X Title: fmt: cached check passes while --no-cache fails after formatting · Issue #479 · rstackjs/rstack-cli

Description: Description Immediately after rs fmt formats and writes a file: rs fmt --check exits with code 0 and reports that formatting is correct. rs fmt --check --no-cache exits with code 1 and reports a formatting issue for exactly the same file...

Open Graph Description: Description Immediately after rs fmt formats and writes a file: rs fmt --check exits with code 0 and reports that formatting is correct. rs fmt --check --no-cache exits with code 1 and reports a fo...

X Description: Description Immediately after rs fmt formats and writes a file: rs fmt --check exits with code 0 and reports that formatting is correct. rs fmt --check --no-cache exits with code 1 and reports a fo...

Opengraph URL: https://github.com/rstackjs/rstack-cli/issues/479

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fmt: cached check passes while --no-cache fails after formatting","articleBody":"## Description\n\nImmediately after `rs fmt` formats and writes a file:\n\n- `rs fmt --check` exits with code 0 and reports that formatting is correct.\n- `rs fmt --check --no-cache` exits with code 1 and reports a formatting issue for exactly the same file.\n- Running cached `rs fmt` again leaves the file unchanged.\n- Running formatting again without cache changes the file.\n\nThis reproduces with a fresh cache directory and does not require an existing project or CI environment.\n\n## Environment\n\n- Linux x64\n- Node.js 24.19.0\n- pnpm 12.3.4\n- Rstack 0.7.3\n- Prettier 3.9.6 (Rstack dependency)\n- yuku-parser 0.9.3 (Rstack dependency)\n\n## Minimal reproduction\n\nCreate the following three files in an empty directory.\n\n### package.json\n\n```json\n{\n  \"private\": true,\n  \"type\": \"module\",\n  \"devDependencies\": {\n    \"rstack\": \"0.7.3\"\n  }\n}\n```\n\n### rstack.config.mjs\n\n```js\nimport { define } from 'rstack';\n\ndefine.fmt({\n  singleQuote: true,\n  trailingComma: 'all',\n});\n```\n\n### example.ts\n\nPlease preserve the exact formatting of this input:\n\n```ts\nconst fetch = rs.fn\u003ctypeof globalThis.fetch>().mockImplementation(() => Promise.resolve(\n  new Response('cached pixels', { headers: { 'content-type': 'image/webp' } }),\n));\n```\n\nHere, `rs` is only an identifier in the formatting input. The code is never executed, so no test framework is required.\n\nInstall dependencies:\n\n```sh\npnpm install\n```\n\nStarting with a nonexistent `repro-cache` directory, run each command separately, in order:\n\n```sh\npnpm exec rs fmt --cache-location ./repro-cache example.ts\n# Exits with 0 and writes the first formatted output, B.\n\npnpm exec rs fmt --check --cache-location ./repro-cache example.ts\n# Exits with 0: Format check passed.\n\npnpm exec rs fmt --check --no-cache example.ts\n# Exits with 1: Formatting issues found in 1 file.\n\npnpm exec rs fmt --cache-location ./repro-cache example.ts\n# Exits with 0, but output B remains unchanged.\n\npnpm exec rs fmt --no-cache example.ts\n# Exits with 0 and changes B into a different output, C.\n\npnpm exec rs fmt --check --no-cache example.ts\n# Exits with 0: Format check passed.\n```\n\n## Expected behavior\n\nCached and uncached checks should produce consistent results for identical file contents, configuration, and tool versions.\n\nFormatting should be idempotent: formatting its output again should not change it.\n\n## Additional investigation\n\nTwo observable behaviors combine to produce this result:\n\n1. For this input, formatting the first output B again produces a different output C.\n2. Rstack caches the first written output B as clean. Subsequent cache hits skip formatting, so they do not detect that B would still be changed by another formatting pass.\n\nIn the installed Rstack 0.7.3 package, `formatFile` in `dist/335.js` stores the hash of `result.formatted` after writing and classifies the cache entry using:\n\n```js\nshouldWrite || unchanged ? 'clean' : 'dirty'\n```\n\nAs a result, a written output is marked clean.\n\nSeparately, directly calling Prettier 3.9.6's `format()` with `parser: 'typescript'`, `singleQuote: true`, and `trailingComma: 'all'` also produces the same B and C.\n\nTherefore, the non-idempotent formatting is not specific to Rstack or its Yuku integration. This report concerns how caching the first written output as clean masks that behavior, causing cached and uncached checks to disagree. There is no evidence that this is a cache-hash collision.\n","author":{"url":"https://github.com/shiyudesu","@type":"Person","name":"shiyudesu"},"datePublished":"2026-09-13T11:00:04Z","url":"https://github.com/rstackjs/rstack-cli/issues/479"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0c7a4104-0921-7877-4c91-3d95e3e8e40b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDC54:1947FF:EA65E9:13C2598:6AEC1DC9
html-safe-noncec1ac06fec002de778e3227d727df8bdeaf69da9d243c8ca12e149e56fd0b6226
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzU0OjE5NDdGRjpFQTY1RTk6MTNDMjU5ODo2QUVDMURDOSIsInZpc2l0b3JfaWQiOiI2ODk5OTQ3MDgyNTkyNTU4NTM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacf50847d0633d10867f2d3847028602991ebf27d62defd0239303f954e23a89ef
hovercard-subject-tagissue:5439634620
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rstackjs/rstack-cli/479/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f25d08477ab42f09ee2580385f0464daf5f6c62e24f604abb847753f352394a3/rstackjs/rstack-cli/issues/479
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f25d08477ab42f09ee2580385f0464daf5f6c62e24f604abb847753f352394a3/rstackjs/rstack-cli/issues/479
og:image:altDescription Immediately after rs fmt formats and writes a file: rs fmt --check exits with code 0 and reports that formatting is correct. rs fmt --check --no-cache exits with code 1 and reports a fo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameshiyudesu
hostnamegithub.com
expected-hostnamegithub.com
Noned063d52022f5f270ef55a70761d126c8085d492d3c251084b07781784c02dad4
turbo-cache-controlno-preview
go-importgithub.com/rstackjs/rstack-cli git https://github.com/rstackjs/rstack-cli.git
octolytics-dimension-user_id129049372
octolytics-dimension-user_loginrstackjs
octolytics-dimension-repository_id1138027854
octolytics-dimension-repository_nworstackjs/rstack-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1138027854
octolytics-dimension-repository_network_root_nworstackjs/rstack-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release56e59340194011ba3cb6809acfa979ccbd174288
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/rstackjs/rstack-cli/issues/479#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Frstackjs%2Frstack-cli%2Fissues%2F479
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%2Frstackjs%2Frstack-cli%2Fissues%2F479
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=rstackjs%2Frstack-cli
Reloadhttps://github.com/rstackjs/rstack-cli/issues/479
Reloadhttps://github.com/rstackjs/rstack-cli/issues/479
Reloadhttps://github.com/rstackjs/rstack-cli/issues/479
rstackjshttps://github.com/rstackjs
rstack-clihttps://github.com/rstackjs/rstack-cli
Codehttps://github.com/rstackjs/rstack-cli
Issues3 (3)https://github.com/rstackjs/rstack-cli/issues
Pull requests1 (1)https://github.com/rstackjs/rstack-cli/pulls
Discussionshttps://github.com/rstackjs/rstack-cli/discussions
Actionshttps://github.com/rstackjs/rstack-cli/actions
Projectshttps://github.com/rstackjs/rstack-cli/projects
Security and qualityhttps://github.com/rstackjs/rstack-cli/security
Insightshttps://github.com/rstackjs/rstack-cli/pulse
https://github.com/rstackjs/rstack-cli
New issuehttps://github.com/login?return_to=https://github.com/rstackjs/rstack-cli/issues/479
New issuehttps://github.com/login?return_to=https://github.com/rstackjs/rstack-cli/issues/479
#481https://github.com/rstackjs/rstack-cli/pull/481
fmt: cached check passes while --no-cache fails after formattinghttps://github.com/rstackjs/rstack-cli/issues/479#top
#481https://github.com/rstackjs/rstack-cli/pull/481
https://github.com/chenjiahan
https://github.com/shiyudesu
shiyudesuhttps://github.com/shiyudesu
on Sep 13, 2026https://github.com/rstackjs/rstack-cli/issues/479#issue-5439634620
https://github.com/elecmonkey
elecmonkeyhttps://github.com/elecmonkey
on Sep 13, 2026https://github.com/rstackjs/rstack-cli/issues/479#issuecomment-5652872049
https://github.com/elecmonkey/rstack-fmt-cache-reprohttps://github.com/elecmonkey/rstack-fmt-cache-repro
https://github.com/elecmonkey
elecmonkeyhttps://github.com/elecmonkey
on Sep 13, 2026https://github.com/rstackjs/rstack-cli/issues/479#issuecomment-5652881115
chenjiahanhttps://github.com/chenjiahan
on Sep 14, 2026https://github.com/rstackjs/rstack-cli/issues/479#event-31079375283
chenjiahanhttps://github.com/chenjiahan
completedhttps://github.com/rstackjs/rstack-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#481https://github.com/rstackjs/rstack-cli/pull/481
on Sep 14, 2026https://github.com/rstackjs/rstack-cli/issues/479#event-31080731248
Sign up for freehttps://github.com/signup?return_to=https://github.com/rstackjs/rstack-cli/issues/479
Sign in to commenthttps://github.com/login?return_to=https://github.com/rstackjs/rstack-cli/issues/479
chenjiahanhttps://github.com/chenjiahan
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.