added device support

This commit is contained in:
nvrl committed 2026-07-10 15:59:56 +02:00
1 parent 6291c6f478
commit 0d07fdb084
3 files changed
+18 -7

No files matched your search

+3 -2
View File
@@ -6,8 +6,8 @@ gitignored, so this file is the only durable record of what we last reviewed.
- **Upstream**: https://github.com/ProtonDriveApps/sdk
- **Reconciled subtree**: `client/cs/sdk/src`
- **Pinned**: `36430318919c30fac42ec8577036a6d6e9de916f`
- **Date**: 2026-06-26
- **Pinned**: `f2496161c2f704b72511aa1b804961285993850c`
- **Date**: 2026-07-10
## Workflow
@@ -23,3 +23,4 @@ gitignored, so this file is the only durable record of what we last reviewed.
|------|-----------|--------|-------|
| 2026-06-25 | initial pin `fb4173ab` | — | baseline; delta reviewed, 0 behavioral changes outstanding |
| 2026-06-26 | `fb4173ab` → `36430318` | `36430318` | ported: enumeration returns `NodeUid`s (`enumerate_folder_children_node_uids` / `enumerate_trash_node_uids`), caller materializes via `enumerate_nodes`. noise dropped: BOM/deps/kt-enum-order/cs-account-refactor |
| 2026-07-10 | `36430318` → `f2496161` | `9a1c39b3` | ported: validation check in `Thumbnail::new` returning `Result` instead of panicking. noise dropped: projects reorg / C# Account client move to incubating. deferred: device support (`32a8eed0`). |
+13 -3
View File
@@ -138,11 +138,21 @@ pub struct Thumbnail {
impl Thumbnail {
/// Create a thumbnail from rendered image bytes.
pub fn new(thumbnail_type: ThumbnailType, content: Vec<u8>) -> Self {
Self {
///
/// Returns an error if the `content` is empty.
pub fn new(
thumbnail_type: ThumbnailType,
content: Vec<u8>,
) -> Result<Self, proton_sdk::error::ProtonError> {
if content.is_empty() {
return Err(proton_sdk::error::ProtonError::invalid_operation(
"Thumbnail content must not be empty.",
));
}
Ok(Self {
thumbnail_type,
content,
}
})
}
}
@@ -260,8 +260,8 @@ async fn thumbnails_upload_and_fetch() {
let thumb_small: Vec<u8> = (0..4096).map(|i| (i * 13 + 1) as u8).collect();
let thumb_preview: Vec<u8> = (0..8192).map(|i| (i * 17 + 3) as u8).collect();
let thumbnails = vec![
Thumbnail::new(ThumbnailType::Thumbnail, thumb_small.clone()),
Thumbnail::new(ThumbnailType::Preview, thumb_preview.clone()),
Thumbnail::new(ThumbnailType::Thumbnail, thumb_small.clone()).unwrap(),
Thumbnail::new(ThumbnailType::Preview, thumb_preview.clone()).unwrap(),
];
let payload = b"file body for thumbnail upload".to_vec();