Skip to content
Snippets Groups Projects
Commit 2d47e1fd authored by Klaus Fischer's avatar Klaus Fischer
Browse files

:safety_vest: ingoring destination metadata version

parent 212dce98
No related branches found
No related tags found
Loading
......@@ -17,5 +17,9 @@ public class DestinationCapability {
CanChunk = true;
});
// TODO(kfischer): Remove this when SSP support chunking meta data version
#warning Remove this when SSP support chunking meta data version
CanChunk = true;
}
}
......@@ -303,9 +303,11 @@ public class Sender : FitConnectClient, ISender {
created.SubmissionId, sendable.CaseId);
Logger?.LogInformation("Uploading pre encrypted attachments");
foreach (var attachment in submission.Attachments) {
await UploadEncryptedAttachmentAsync(sendable.Id!, attachment.Key, attachment.Value);
}
if (submission.Attachments != null)
foreach (var attachment in submission.Attachments) {
await UploadEncryptedAttachmentAsync(sendable.Id!, attachment.Key, attachment.Value);
}
if (submission.Attachments != null) {
sendable.Attachments ??= new();
......@@ -355,6 +357,10 @@ public class Sender : FitConnectClient, ISender {
var introducedSubmission =
await CreateSubmissionOnServerAndUploadAttachments(sendableSubmission, isReply, publicKey?.ToJson());
if (introducedSubmission.Attachments != null && introducedSubmission.Attachments.Any(a => a is LargeAttachment) && !DestinationCapability.CanChunk)
throw new FitConnectSenderException("Destination does not support chunking");
await UploadAttachmentsAsync(publicKey?.ToJson(), introducedSubmission);
return (SentSubmission)await FinishSubmissionTransmission(introducedSubmission, publicKey);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment