Skip to content

feat(drive): add ClientUID support for draft ownership tracking#201

Open
tomholford wants to merge 1 commit intoProtonMail:masterfrom
tomholford:feature/drive-clientuid-support
Open

feat(drive): add ClientUID support for draft ownership tracking#201
tomholford wants to merge 1 commit intoProtonMail:masterfrom
tomholford:feature/drive-clientuid-support

Conversation

@tomholford
Copy link
Copy Markdown

@tomholford tomholford commented Jan 7, 2026

Summary

Add ClientUID field to Drive API types per official Proton Drive OpenAPI spec.

This is a step towards resolving henrybear327/Proton-API-Bridge#16

Changes

  • CreateFileReq.ClientUID: identifies which client created a file draft
  • CheckAvailableHashesReq.ClientUID: filters pending drafts by client UIDs
  • CheckAvailableHashesRes / PendingHashData: returns draft ownership info

Why

Enables clients to:

  • Safely auto-replace their own failed upload drafts
  • Avoid overwriting concurrent uploads from other clients

This is critical for reliable file uploads - when an upload fails partway through, it leaves an orphaned draft. Without ClientUID, clients cannot distinguish between:

  • Their own failed drafts (safe to replace)
  • Another client's active upload (should NOT replace)

Reference

These types match the official ProtonDriveApps/sdk driveTypes.ts which is auto-generated from the Proton Drive OpenAPI spec:

// From sdk/js/sdk/src/internal/apiService/driveTypes.ts
CreateFileDto: {
    ClientUID: string | null;  // "Client unique ID. Useful for marking client's drafts..."
    // ...
}

CheckAvailableHashesRequestDto: {
    ClientUID: string[] | null;  // "Client UID list to filter pending drafts with..."
}

PendingHashResponseDto: {
    ClientUID?: string | null;
}

@tomholford tomholford marked this pull request as ready for review January 7, 2026 01:04
Add ClientUID field to Drive API types per official Proton Drive OpenAPI spec:

- CreateFileReq.ClientUID: identifies which client created a file draft
- CheckAvailableHashesReq.ClientUID: filters pending drafts by client UIDs
- CheckAvailableHashesRes/PendingHashData: returns draft ownership info

This enables clients to:
- Safely auto-replace their own failed upload drafts
- Avoid overwriting concurrent uploads from other clients

Reference: ProtonDriveApps/sdk driveTypes.ts (auto-generated from OpenAPI)
@tomholford tomholford force-pushed the feature/drive-clientuid-support branch from 0b89e7d to 315073b Compare February 13, 2026 23:33
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