A timeout, or a 504 from a gateway, can come after the server acted on a request. Repeating a write then met the first attempt's result: a folder creation whose answer was slow failed with AlreadyExists for the folder the first attempt made. Writes are now retried only when they were not acted on (a failed connection, 408, 429, 502, 503). Block uploads, which can be repeated safely, get their own Replay::Idempotent and keep retrying on a timeout; reads are unchanged. Found with the self-hosted server's stall fault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 KiB
Changelog
Notable changes to proton-sdk and proton-drive-rs. The format follows
Keep a Changelog; versions follow semver,
and both crates are released together under the workspace version. Upstream
commits a change ports are recorded in UPSTREAM_SYNC.md.
This file starts after 0.9.2; earlier changes are in the git history.
[Unreleased]
Added
- The SDK creates the photos volume.
upload_photoand the newProtonPhotosClient::get_or_create_photos_rootcreate the account's photos volume (POST photos/volumes) when it has none, as C#GetOrCreatePhotosFolderAsyncdoes, so an account used only through the SDK gets one.get_photos_rootstays read-only. - A server can sign its own SRP modulus.
ProtonClientConfiguration::with_trusted_modulus_keytrusts a modulus signed by another key besides Proton's, for sign-in, opening public links and creating them.crypto::generate_proofs_trustingandgenerate_verifier_trustingtake the extra keys; the existing functions trust Proton's key alone, as before. - Extra root certificates.
ProtonClientConfiguration::with_extra_root_certificatetrusts the PEM certificates it is given on top of the bundled web PKI roots, for a server behind a private certificate authority. A document with no certificate in it fails the client build. ApiHttpClient::configreturns the configuration a client was built from.- Public link URLs can point at another host.
ProtonDriveClient::with_public_link_basesets the origin the client builds public link URLs on; it defaults toDEFAULT_PUBLIC_LINK_BASE(https://drive.proton.me). Only URLs the client rebuilds itself use it, which today meanslist_bookmarks: the API answers bookmarks with a token only. Links answered with aPublicUrlkeep the server's URL.
Fixed
- Members can open photos in an album another user shares. A shared album
is parentless on its owner's photos volume and wrapped to the member's
share, but the photos path opened every parentless node with the caller's
own Photos share key and failed with
failed to decrypt: missing key. Thev2/sharedwithmeshare index now records albums and photos too, and the photos path looks a parentless node up there before falling back to the Photos share. Downloading, copying and saving such photos now works. - Renaming or moving a shared node no longer breaks its name for
members.
rename_nodeand moves encrypted the new name under a fresh session key, while the share'sNameKeyPacketstill held the old one, so a member'sget_nodefailed with "Modification Detection Code error". The name is now encrypted under its current session key, as the TypeScript SDK does. - A write that timed out is no longer sent again. A timeout, or a
504from a gateway, can come after the server acted on the request. Repeating it then met the first attempt's result: creating a folder whose answer was slow failed withAlreadyExistsfor the folder the first attempt made. Writes are now retried only when they were not acted on (a failed connection,408,429,502,503); the caller sees the timeout instead. Reads keep retrying, and block uploads, which can be repeated safely, keep retrying on a timeout.
[0.12.11] — 2026-11-29
Changed
- A block download no longer waits on HTTP/2 flow control. Every client now lets a server send 8 MiB of one response, and 32 MiB across a connection, before it has been read. hyper's defaults of 2 MiB and 5 MiB made a single 4 MiB block stop twice for a round trip, which capped one download near 9 MiB/s at 150 ms whatever the link could do. This is what limits a video player that reads one block at a time.
[0.12.10] — 2026-11-28
Added
- An API call's
http_requestevent says how many times it was sent. Its newattemptsattribute counts the first send, each retry theRetryPolicymade, and the replay after a token refresh. The refresh request itself is not counted. There is still one event per logical call, so a counter can report calls and sends separately. This covers session API calls, multipart posts and the*_observedsession-less helpers. Block storage transfers do not carry the attribute yet.
[0.12.9] — 2026-11-28
Added
- A public link can report its requests from the first one.
ProtonDrivePublicLinkClient::open_with_telemetryandinfo_with_telemetrytake aTelemetrysink before the handshake starts. The sink receives anhttp_requestevent for the link'sinfoandauthrequests, every API call of the anonymous session, the session's block downloads, and the handshake again when an expired session is replaced. The handshake routes are reported asdrive/urls/{token}/infoanddrive/urls/{token}/auth, and the token itself is never reported.openandinfoare unchanged and report nothing. proton_sdk::http::get_unauthenticated_observedandpost_unauthenticated_observedreport onehttp_requestevent per call, under a route label the caller gives, to the sink inObserved. Retries inside the call are not counted separately.
[0.12.8] — 2026-11-28
Added
- A new revision can be uploaded only over the revision the caller expects.
upload_new_revision_overtakes the id of the revision the caller last saw. It returnsRevisionUpload::Movedwhen another client has committed one since, andRevisionUpload::Trashedwhen the file is in the trash. In both cases nothing is sent. The check uses the read of the file's link that the upload needs for its keys anyway, so it costs no request. A caller that read the file itself to make the same check can drop that read.
Changed
- A folder's hash key is read once. Every new file, folder, rename and move into a folder read the folder's link again to get the key that hashes its children's names. The key is now cached next to the folder's node key, and dropped with it on the folder's events. A second upload into a folder sends no read of the folder.
[0.12.7] — 2026-11-28
Added
- Uploads can return the revision they sealed.
upload_file_replacing_draft_sealedandupload_new_revision_sealedwork likeupload_file_replacing_draft_fromandupload_new_revision_from, and return aSealedUploadwith the file's uid and the id of the revision they sealed. Drive often does not list a node made a moment ago, so a client that read the file back to learn that id often got nothing. The existing functions are unchanged. - Streaming uploads use the one-request small upload. With
with_small_file_upload(true), the streaming calls now send a small file in one request instead of three or more. These areupload_file_from,upload_file_replacing_draft_from/_sealed,upload_new_revision_fromandupload_new_revision_sealed, plus the bufferedupload_fileandupload_new_revisionbuilt on them. Before, only the buffered calls did. The request isfiles/smallorrevisions/small.- To decide, the call reads up to the small-upload budget plus one byte
into memory: at most about 116 KiB, less the thumbnails. A reader with more
than that sends what was read ahead, then the rest, through the block path,
so a file that grew since its
intended_sizewas taken still goes up whole. - It falls back to the block path in three cases: the API reports a name or
draft conflict (
AlreadyExists), the file's keys cannot be read before a small revision, or the thumbnails alone exceed the budget. As before, it never resends a small request after any other failure, since one request creates and seals together.
- To decide, the call reads up to the small-upload budget plus one byte
into memory: at most about 116 KiB, less the thumbnails. A reader with more
than that sends what was read ahead, then the rest, through the block path,
so a file that grew since its
- The small upload carries what the block path does. Thumbnails go in the
same request, one
ThumbnailBlockType_{type}part each, and count against the 128 KiB budget. A new file keeps its modification time and its AEAD choice. Both endpoints return the revision they sealed. A small revision drops the cached node, as a seal does. This matches the C# SDK. - Telemetry names the upload path and the endpoint.
upload_fileandupload_new_revisionevents carrybackend=smallorbackend=blocks. Eachhttp_requestevent carriesendpoint: the path without its query, with ids replaced by{id}.
Fixed
- A file read right after a new revision of it is uploaded shows that
revision. Sealing a revision left the file's node in the entity cache, so
get_nodekept reporting the replaced revision as active until a Drive event invalidated it. Sealing now drops the node from the cache, asrestore_revisionalready did.
[0.12.6] — 2026-11-22
Fixed
- Emptying the trash no longer reports an error when it works. The server
answers
DELETE volumes/{vid}/trashwith HTTP 202 and empties the trash in the background.empty_trashtreated that answer as a failure. It now treats it as success, asrestore_revisionalready does.
[0.12.5] — 2026-11-22
Fixed
- Listing a large trash no longer runs forever.
enumerate_trash_node_uidssent its paging parameters in lower case, unlike every other paged request, and asked for another page as long as pages came back full. On a large trash it never finished. It now sendsPageandPageSize, and it stops when a page brings no link it has not seen, after at most 10 000 pages.
Added
ProtonDriveClient::enumerate_trashed_nodes_lightreturns trashed nodes with the time each was trashed (TrashedNode), whichNodedoes not carry.
[0.12.4] — 2026-11-21
Added
ProtonPhotosClient::find_missing_thumbnailslists which photos have no thumbnail, from link details read in batches, without downloading any.
[0.12.3] — 2026-11-21
Changed
- Thumbnails need fewer round trips.
download_thumbnailused to make four requests in a row for each thumbnail: link details, the revision's full block list (only to find the thumbnail ids), the thumbnail URL, and the blob.- The thumbnail ids now come from the link details when the API lists them
there (
ActiveRevisionDto::thumbnails). The revision is read only when it doesn't. - The client remembers each file's content key and thumbnail ids, for up to 4096 files. A repeat request, a retry, or a fall back from the small thumbnail to the preview then needs only the URL and the blob.
- A node's events drop its entry, and so does a failed fetch from a remembered entry, which then looks the file up again.
- The thumbnail ids now come from the link details when the API lists them
there (
[0.12.2] — 2026-11-20
Added
proton_sdk::login: the whole sign-in as a small state machine.login::beginruns the password step and returns aStep:SecondFactor,MailboxPassword, orUnlockfor a one-password account.Pending::second_factortakes a code.Pending::mailbox_passwordandPending::unlockderive the key passphrases and hand backUnlocked(session, key passphrases, key salts). Both work by reference, so a mistyped mailbox password or a dropped connection can be retried on the same session.LoginErrorsorts failures into what a frontend acts on: a CAPTCHA gate, an account whose only second factor is a security key, a blocked client, a refused password, a wrong code, a wrong mailbox password. This sequence previously lived in each app; it moves here fromproton-auth-rs.ProtonApiSession::resume_parametersandresume_parameters_with(tokens), which build theResumeParametersfor storing a session, with the current tokens or the pair a refresh handed over.PasswordMode::from_wireis public, with its inversePasswordMode::to_wire, for callers that store Proton's number.HumanVerification::token_from_message, which takes the solved token out of a message the verification page posts, and ignores the page's other messages.proton_drive_rs::parse_public_link_urlis public, so apps can check a pasted share link, or key their records by its token, without opening it.
Changed
parse_public_link_urlignores surrounding whitespace and a query string before the fragment (…/urls/TOKEN?ref=x#password).ResumeParameters'Debugoutput leaves the access and refresh tokens out.
[0.12.1] — 2026-11-17
Fixed
- Uploads from a device whose clock runs ahead of Proton's. A new node key
and its self-signatures were dated with the device clock. Proton's servers
ignore self-signatures dated after their own clock, so a phone only a few
seconds fast created keys without a usable encryption subkey, and every new
file or photo failed with 422 "Could not verify the nodeKey was used for
encrypting contentKeyPacket" (code 200501). New keys and their
self-signatures are now dated with the server's time, taken from the
Dateheader of its latest response, as the C# SDK'sCryptographyTimeProvisionHandlerdoes. Before the first response the device clock is used.
Added
proton_sdk::crypto::note_server_date, which records a serverDateheader.ApiHttpClientcalls it for every response; only a client that talks to the API through its own HTTP stack needs it.
[0.12.0] — 2026-11-15
Fixed
- Photo duplicate checks no longer fail on drafts. The duplicates endpoint
sends
HashandContentHashasnullfor a draft left by an interrupted upload. Both fields wereString, so one such draft failed the wholefind_duplicates,find_duplicates_manyorname_collisionscall with "invalid type: null, expected a string". Drafts, trashed and deleted links and candidates without hashes are now skipped, like the TypeScript SDK does. nullfor a defaulted field.#[serde(default)]only covers a missing field. The DTO fields with a default (lists, strings, numbers, flags) now also read an explicitnullas that default.- Failed uploads remove their draft. A new file or photo whose block upload failed left its draft on the server, and the draft then blocked the next attempt at that name. The draft is now deleted, as in the C# and TypeScript SDKs. After a failed seal it is only deleted when the server clearly rejected the seal, because a seal lost in transit may have been applied.
- A response that cannot be decoded is logged with its API path.
Added
PhotoUploadMetadata::replace_existing_draft: replace an unsealed draft of the same name from any client, not only this session (C#overrideExistingDraftByOtherClient). A resumed import needs it after a fresh login, because the server compares drafts against the session id.PhotoUploadMetadata::location: write the photo's position to the encrypted extended attributes (Location { Latitude, Longitude }), as the web client does. Build it withPhotoLocation::from_claimed.FoundPhotoDuplicateDto::active_name_hashandknown_content_hash.
Breaking
PhotoUploadMetadatahas two new fields. Struct literals must set them or use..Default::default().FoundPhotoDuplicateDto::name_hashandcontent_hashareOption<String>.ExtendedAttributeshas a newlocationfield.
[0.11.0] — 2026-11-05
Changed
- Modification timestamps retain their UTC offset and fractional seconds.
Folder creation, streaming file uploads (including draft replacement), and
revision uploads accept
ModificationTime, an alias forchrono::DateTime<chrono::FixedOffset>. Ported from upstream271f64e4. Downloaded claimed timestamps remain verbatim strings.
Added
PhotoUploadMetadata::last_modification_time, independent ofcapture_time. An unset modification time is omitted; capture time still defaults to the upload time.
Breaking
-
Modification-time parameters change from
Option<i64>toOption<ModificationTime>.Noneneeds no change. For an offset timestamp:use proton_drive_rs::ModificationTime; let modified: ModificationTime = "2026-11-05T09:55:00.1234567+08:00".parse()?; // Pass Some(modified) to create_folder or a streaming upload.For epoch seconds, add
chrono = "0.4"to the caller's dependencies and usechrono::DateTime::from_timestamp(seconds, 0).map(|time| time.fixed_offset()). This yields a UTC offset and returnsNonefor an out-of-range timestamp. -
PhotoUploadMetadatastruct literals must providelast_modification_timeor use..Default::default(). Photo uploads no longer copy capture time into modification time; set both fields explicitly when that is intended.
[0.10.1] — 2026-10-31
Fixed
- Address keys whose token is for an inactive account key. An address key's
token was decrypted with the active account keys only. A token encrypted to
an account key since marked inactive never opened, although that key still
opens with the password, so the address failed with "has no primary key".
Tokens are now tried with every account key that opens, active ones first.
Signing still uses active keys only.
AccountClient::key_reportfollows the same chain. - One broken address no longer fails the account.
AccountClient::addressesfailed as a whole when any one address's keys did not open. That address is now left out with a warning, and the others work. It fails only when no address opens.address_private_keysnames the reason for a left-out address, anddefault_addressfails with it when the left-out address is the default, instead of handing out the next address.
Added
AccountClient::address(id): one address by id, failing with the reason when its keys did not open.proton-drive-rsuses it to resolve membership addresses, which before said "membership address not found" for such an address.
[0.10.0] — 2026-10-26
Added
- Server-side copy.
ProtonDriveClient::copy_node(uid, new_parent, name)copies a file, or a folder with everything in it, without downloading and uploading it. The copy may get a new name and may land on another volume; the returned uid is on the target volume. Ported from the TypeScript SDK (copyNode). - Folder size.
ProtonDriveClient::get_folder_size(uid)returns aFolderSizewith the total size and the number of descendants, trashed nodes included. Folders count as descendants, and the size is in encrypted bytes. Ported from the TypeScript SDK (getFolderSize). - Changing a public link.
ProtonDriveClient::update_public_link(uid, role, custom_password, expiration_time)sets the role, the custom password and the expiry of the link on a node. The URL does not change.Noneremoves a custom password or an expiry. A legacy link cannot be updated. Ported from the TypeScript SDK (updateSharedLink). - A public link's custom password.
PublicLink::custom_passwordholds the custom password of a link, recovered from the stored link password, so a caller can keep it whileupdate_public_linkchanges the role or the expiry. - Walking a public link.
ProtonDrivePublicLinkClient::enumerate_subtreeandenumerate_subtree_reportingreturn every node below a shared folder, breadth first, listing several folders of a level at once. - Bookmark names.
list_bookmarksnow decrypts the bookmarked item's name intoBookmark::node_name, and returns the link's custom password in the newBookmark::custom_passwordfield. - Album capabilities from the C# SDK (
a36cc423):ProtonPhotosClient::set_album_cover;ProtonPhotosClient::delete_album_saving_photos, which onAlbumContainsPhotosNotInTimeline(code 200302) saves the photos that are only in the album to the timeline and deletes the album again;add_photos_to_albumadds photos from another volume by copying them in, instead of refusing them;- a photo group the server reports as incomplete is retried once with the missing related photos.
ResponseCode::AlbumContainsPhotosNotInTimeline.ApiHttpClient::post_query, a POST that only reads and may be sent again.
Changed
- A read is sent again when its connection drops. A GET, a block download or
a
post_querythat loses its connection mid-request or while reading the body is retried under the client's retry policy. A write still is not: it may have been applied. Read-only POSTs inproton-drive-rs(link details, thumbnails, photo duplicates,checkAvailableHashes) now usepost_query. DebugforPublicLinkandBookmarkno longer prints the URL or the custom password; it shows<redacted>instead.remove_photos_from_albumrefuses a photo on another volume per photo, in the input order, without sending it.
Fixed
- A bookmark's URL fragment is now only the generated password, as in the URL the web client shows. It used to include the custom password as well.
Breaking
BookmarkandPublicLinkhave a new public field,custom_password. Code that builds either with a struct literal must set it.ResponseCodehas a new variant. An exhaustivematchon it needs an arm.