Skip to content

feat(bulk): return per-file revisions from /fs/bulk#64

Merged
khaliqgant merged 1 commit intomainfrom
fix/bulk-write-per-file-revisions
Apr 24, 2026
Merged

feat(bulk): return per-file revisions from /fs/bulk#64
khaliqgant merged 1 commit intomainfrom
fix/bulk-write-per-file-revisions

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Apr 24, 2026

Summary

Extend /fs/bulk response with per-file results so mount clients do not need a follow-up GET /fs/file per batched write to learn new revisions.

Why

Workflow 060 migrated the mount daemon from per-file POST /fs/file to POST /fs/bulk. That eliminated per-file WRITES but left per-file GETs for revision read-back, because the /fs/bulk response did not carry per-file revisions. Total request count for an N-file batch was still N+1.

Server already computes per-file revisions in Store.BulkWrite / Store.BulkWriteFork. This PR surfaces them in the HTTP response as an additive results array.

Backward compatibility

Purely additive — existing response fields unchanged. Clients on older SDKs ignore the extra field; the mount code already handles missing results by falling back to ReadFile.

Proof

TestBulkMigrationReducesHTTPCalls now asserts 0 total requests on /fs/file (previously only 0 POST /fs/file, because GET fallbacks were expected). See docs/bulk-per-file-revisions-boundary.md for scope and docs/bulk-per-file-revisions-review.md for the approved review.

Authored by workflows/061-bulk-write-per-file-revisions.ts.


Open in Devin Review

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

The existing /fs/bulk response only returned {written, errorCount, errors,
correlationId}. Mount clients had to follow every bulk write with N GET /fs/file
requests to learn the new revisions for If-Match. That made the post-migration
total request count N+1 for an N-file batch.

Extend the response with a per-file results array:
  {"path":..., "revision":..., "contentType":...}

Purely additive — existing fields unchanged. Mount now uses the inline revision
and skips the ReadFile fallback. The e2e proof TestBulkMigrationReducesHTTPCalls
tightens from "0 POST /fs/file" to "0 total requests on /fs/file".
@khaliqgant khaliqgant force-pushed the fix/bulk-write-per-file-revisions branch from 12eb7d4 to 105b859 Compare April 24, 2026 20:33
Base automatically changed from fix/mount-bulk-sync-migration to main April 24, 2026 20:36
@khaliqgant khaliqgant merged commit 699915c into main Apr 24, 2026
6 checks passed
@khaliqgant khaliqgant deleted the fix/bulk-write-per-file-revisions branch April 24, 2026 20:37
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