Conversation
Extract pure S3 versioning logic from auto-drive into the SDK. Exposes deleteMarkerVersionId, resolveDeleteMarkerResult, buildListVersionsResult, and supporting types (S3VersionEntry, S3DeleteMarkerEntry, ListObjectVersionsParams, ListObjectVersionsResult, DeleteObjectResult, S3VersionRow). Refs autonomys#690
Review: auto-sdk #696 - S3 ListObjectVersions + delete marker helpersChecked against the source: auto-drive#789 head VerdictThe core choice is right. Two problems: the guardrails didn't come with it, and the helpers needed to use it were left Blocking1. Undocumented over-fetch precondition - silent data loss. 2. The two comments that mattered most were dropped. The 3. Missed
Object Lock / versioning bodies ( Lower priority: Smaller points
Test gapsThe 13 tests are well written but cover only happy paths. Missing: the truncation precondition Order of workReleases here are manual ( Must be in this PR - blocking 1-3, Must be in the same release - Separate PRs. Object Lock bodies (in scope by this PR's own description, small and pure - |
Resolves #690
Refs autonomys/auto-drive#789
Summary
Following the code review in
autonomys/auto-drive#789by @jim-counter and tracking issue #690 by @EmilFattakhov, this PR extracts the pure S3 versioning logic and delete marker helpers fromapps/backend/src/core/s3/index.tsinto the SDK's@autonomys/file-serverpackage (src/s3/):Delete Marker Helpers:
deleteMarkerVersionId(deletedAt: Date): Formats deterministic delete marker version IDs (dm-${deletedAt.getTime()}).resolveDeleteMarkerResult(deletedAt): FormatsDeleteObjectResultforDeleteObjectresponses withx-amz-delete-markerheaders.Types:
S3VersionEntry,S3DeleteMarkerEntry,ListObjectVersionsParams,ListObjectVersionsResult,S3VersionRow,DeleteObjectResult.Pure Aggregation Engine:
buildListVersionsResult(rows: S3VersionRow[], maxKeys: number):isLatest: true.isLatest: true) for soft-deleted (pointerDeletedAt) or owner-removed keys.isTruncatedandnextKeyMarker.Verification
src/s3/__tests__/listObjectVersions.test.ts.@autonomys/file-serverpass (5/5test suites green).