Skip to content
File

Blob: src/worker/db/file-dav-do/types.ts

typescript16 lines
1import type { ParsedIfHeader } from "@/worker/dav/if-header";
2 
3// Snapshot of write preconditions captured at beginWrite. commitWrite revalidates
4// these against the live tree so a concurrent change between R2 upload and commit
5// cannot silently overwrite an unrelated update or bypass an in-flight lock.
6// Stored as JSON in pending_uploads.expected_state_json.
7export interface PendingUploadExpectedState {
8 expectedNodeId: string | null;
9 expectedEtag: string | null;
10 expectedVersion: number | null;
11 ifMatch: string | null;
12 ifNoneMatch: string | null;
13 ifHeader: ParsedIfHeader;
14 lockTokens: string[];
15}