Skip to content

fix(files): file version history follow-ups - #8010

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/file-versions-followups
Sep 19, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/file-versions-followups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Metadata currentVersion, version list/get, and revert now agree with the writer when the newest version row no longer holds the file's bytes (a content write that skipped recording, e.g. from a build predating version history): they report the implicit next version the next write records, so a revert precondition always names the current bytes
  • The newest version row is never deletable (409), so version numbers are never reused
  • Retention cleanup carries a run-wide row cap plus a per-workspace-chunk batch budget, matching the other cleanup jobs
  • List File Versions description names both coalescing cutoffs (10-minute window, 5-minute idle)
  • Inline storage-cleanup failures log describeError instead of raw driver text
  • Test schema mock drops the removed contentUpdatedAt version column
  • CLI: files versions list/describe show authors by email (id once the account is gone) via a new people format; files versions revert prints fields instead of nested JSON
  • Addresses the file-version review threads on v0.8.48: search improvements, file versions #8008

Type of Change

  • Bug fix

Testing

  • 15/15 Postgres integration tests; the new stale-head test fails on the previous query and passes now
  • 3066 sim unit tests, 1165 CLI tests (new renderer tests fail without the fix)
  • lint, check:audits, docs-manifest:check, type-check; generators produce no drift
  • Exercised version history end to end on staging over MCP and the CLI

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 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Sep 19, 2026 6:11pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable new defects remain, and the previously reported cleanup cap overflow was fixed and its thread resolved.

Summary

This PR aligns file-version readers, deletion behavior, cleanup limits, documentation, and CLI rendering with the version writer’s semantics.

  • Re-reads file metadata and version rows within a repeatable-read snapshot, including implicit current versions left by older unrecorded writes.
  • Prevents deletion of the newest recorded version and preserves monotonic version numbering.
  • Bounds retention cleanup by per-workspace batch budgets and a run-wide row cap.
  • Improves CLI author and revert output, cleanup logging, generated API descriptions, schema mocks, and regression coverage.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Authorized file-version operation] --> B[Load active file]
  B --> C[Open read-only repeatable-read snapshot]
  C --> D[Re-read current file metadata]
  D --> E[Read stored version rows and newest head]
  E --> F{Head still holds current bytes?}
  F -->|Yes| G[Return recorded current version]
  F -->|No| H[Expose implicit next version]
  H --> I[Next content write materializes that version]
  G --> J[List, read, revert, or delete response]
  I --> J
Loading

Reviews (3) · Last reviewed commit: "fix(files): read file versions against o..."

Comment thread apps/sim/background/cleanup-file-versions.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-versions.ts Outdated
Comment thread apps/sim/lib/api/contracts/v2/openapi/files-audit.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit d9e8c4a into staging Sep 19, 2026
34 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/file-versions-followups branch September 19, 2026 18:40
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.

1 participant