Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk blobs #7868

Merged
merged 7 commits into from
Nov 5, 2024
Merged

Sdk blobs #7868

merged 7 commits into from
Nov 5, 2024

Conversation

ganthern
Copy link
Contributor

@ganthern ganthern commented Nov 5, 2024

No description provided.

ganthern and others added 5 commits November 5, 2024 10:40
they're de facto already optional since they're
assigned by the server in almost all cases.
an exception are aggregates, but those get their ids
lazily.
Needed for the import (attachment upload).
the customids for some aggregated data transfer types
are generated in BlobAccessTokenFacade since they're not
encrypted and bypass the place where it's usually done.
@@ -183,10 +183,12 @@ function rustValueType(valueName, type, value) {
let innerType
if (valueName === "_id" && (type.type === Type.ListElement || type.type === Type.BlobElement)) {
if (value.type === ValueType.CustomId) {
innerType = "IdTupleCustom"
innerType = "Option<IdTupleCustom>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's probably no way for us to avoid making IDs optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there probably is, but I think it would involve some major changes to how we think about entities and their metadata

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or at least we would need a "here's data to create this thing" structure for each of them so yeah, just was wondering if you considered some options. I will admit (reluctantly) that this is probably the most pragmatic option

rustls = { version = "*", optional = true }
form_urlencoded = "1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we pull in some URL crate instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought about using url and decided to just pull this in directly since we didn't depend on url yet

tuta-sdk/rust/sdk/src/blobs/blob_access_token_facade.rs Outdated Show resolved Hide resolved
use tutasdk::tutanota_constants::ArchiveDataType;
use tutasdk::Sdk;

fn main() -> Result<(), Box<dyn Error>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't tokio have a macro to do this dance?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I tried using it but had some problems. now it works though, so we changed it.

@ganthern ganthern marked this pull request as ready for review November 5, 2024 12:44
@ganthern ganthern merged commit 6f765e6 into master Nov 5, 2024
2 checks passed
@ganthern ganthern deleted the sdk-blobs branch November 5, 2024 12:54
@ganthern ganthern self-assigned this Nov 8, 2024
@mpfau mpfau added the state:tested We tested it and are about to release it label Nov 8, 2024
@ganthern ganthern removed their assignment Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:tested We tested it and are about to release it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants