Skip to content

fix(file): clear unused content when writing files - #7784

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/file-write-unused-content
Sep 11, 2026
Merged

fix(file): clear unused content when writing files#7784
waleedlatif1 merged 2 commits into
stagingfrom
fix/file-write-unused-content

Conversation

@mzxchandra

@mzxchandra mzxchandra commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Explicitly clear unused Content when File Write receives a file so executor input merging cannot restore null or empty text.
  • Preserve text-only writes and validation for conflicting file and text inputs.

Type of Change

  • Bug fix

Testing

  • 125 tests passed, including executor regression coverage.
  • Verified upload → File Read → File Write → download in Arc against local dev servers; downloaded bytes match.
  • Verified overwrite, conflicting Content rejection, empty text-only writes, and local deployed execution.
  • Type-check, lint, block-registry check, all 46 audits (including API boundary validation), and docs manifest check passed.

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)

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 11, 2026 8:04pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the prior malformed-Content issue is fully fixed and no new actionable failures remain.

Summary

  • Explicitly serializes unused Content as undefined when a file is selected.
  • Preserves malformed or populated Content for contract validation.
  • Adds executor regression tests for empty, null, omitted, conflicting, malformed, and text-only Content values.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[File Write inputs] --> B{File selected?}
    B -- No --> C[Preserve Content]
    B -- Yes --> D{Content is null, undefined, or empty?}
    D -- Yes --> E[Set Content to undefined]
    D -- No --> F[Preserve Content for contract validation]
    C --> G[Validate and execute write]
    E --> G
    F --> G
Loading

Reviews (2) · Last reviewed commit: "fix(file): preserve validation for malfo..."

Comment thread apps/sim/blocks/blocks/file.ts
@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1
waleedlatif1 merged commit f4a86ee into staging Sep 11, 2026
33 of 34 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/file-write-unused-content branch September 11, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants