Skip to content

fix(platform-deno): apply writeFile modes only during creation - #7943

Merged
tim-smart merged 3 commits into
Effect-TS:mainfrom
kitlangton:audit/c2-r1-deno-writefile-mode-existing
Sep 4, 2026
Merged

tim-smart merged 3 commits into
Effect-TS:mainfrom
kitlangton:audit/c2-r1-deno-writefile-mode-existing

Conversation

@kitlangton

@kitlangton kitlangton commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Why

The Deno adapter forwarded an explicit mode to Deno.writeFile, which changes the permissions of an existing file. The Node adapter forwards mode to Node's fs.writeFile, where it is used when creating a file and existing permissions are preserved. The platform adapters should agree on that behavior.

What changed

  • Route Deno writes with an explicit mode through the existing open/write path, which applies the mode during creation without changing existing permissions.
  • Cover both sides of the behavior: a new file receives the requested mode, while an existing file keeps its current mode.
  • Add an @effect/platform-deno patch changeset.

Verification

  • Focused native Deno test: 22 passed, 1 pre-existing skip.
  • pnpm --filter @effect/platform-deno check
  • pnpm lint-fix
  • pnpm check

Closes #7942

Closes EFF-1193

@changeset-bot

changeset-bot Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89fb1a1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@effect/platform-deno Patch
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 34.04 KB 34.04 KB 0.00 KB (0.00%)
basic.ts 7.14 KB 7.14 KB 0.00 KB (0.00%)
batching.ts 10.38 KB 10.38 KB 0.00 KB (0.00%)
brand.ts 6.63 KB 6.63 KB 0.00 KB (0.00%)
cache.ts 11.02 KB 11.02 KB 0.00 KB (0.00%)
config.ts 21.75 KB 21.75 KB 0.00 KB (0.00%)
differ.ts 20.55 KB 20.55 KB 0.00 KB (0.00%)
http-client.ts 22.32 KB 22.32 KB 0.00 KB (0.00%)
logger.ts 11.11 KB 11.11 KB 0.00 KB (0.00%)
metric.ts 9.24 KB 9.24 KB 0.00 KB (0.00%)
optic.ts 6.86 KB 6.86 KB 0.00 KB (0.00%)
pubsub.ts 15.49 KB 15.49 KB 0.00 KB (0.00%)
queue.ts 12.09 KB 12.09 KB 0.00 KB (0.00%)
schedule.ts 11.20 KB 11.20 KB 0.00 KB (0.00%)
schema-binary.ts 39.70 KB 39.70 KB 0.00 KB (0.00%)
schema-class.ts 20.31 KB 20.31 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 30.47 KB 30.47 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 26.41 KB 26.41 KB 0.00 KB (0.00%)
schema-string-transformation.ts 13.89 KB 13.89 KB 0.00 KB (0.00%)
schema-string.ts 11.38 KB 11.38 KB 0.00 KB (0.00%)
schema-template-literal.ts 15.75 KB 15.75 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 33.59 KB 33.59 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 24.75 KB 24.75 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 19.51 KB 19.51 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 19.65 KB 19.65 KB 0.00 KB (0.00%)
schema-toFormatter.ts 19.76 KB 19.76 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 23.84 KB 23.84 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 19.78 KB 19.78 KB 0.00 KB (0.00%)
schema.ts 19.52 KB 19.52 KB 0.00 KB (0.00%)
stm.ts 13.02 KB 13.02 KB 0.00 KB (0.00%)
stream.ts 10.05 KB 10.05 KB 0.00 KB (0.00%)

@tim-smart tim-smart added the audit Findings originating from the Effect runtime correctness audit label Sep 3, 2026
@tim-smart
tim-smart force-pushed the audit/c2-r1-deno-writefile-mode-existing branch from cb16fc0 to 0012694 Compare September 3, 2026 20:32
@tim-smart
tim-smart merged commit 862ba71 into Effect-TS:main Sep 4, 2026
8 of 10 checks passed

This branch had an error being deployed

1 failed deployment
fork — 89fb1a1b Deployed Sep 3, 2026 by tim-smart via approval-gate #13860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0 audit Findings originating from the Effect runtime correctness audit bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deno FileSystem writeFile applies creation modes to existing files

2 participants