A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: Incorrect math for determining total number of chunks causes erroneous assertation that there is one more chunk in certain conditions.
Chloe Oletto011cc992e845
diff --git a/apps/mobile/app/common/filesystem/download.ts b/apps/mobile/app/common/filesystem/download.tsindex 1448d2875..110aa335c 100644--- a/apps/mobile/app/common/filesystem/download.ts+++ b/apps/mobile/app/common/filesystem/download.ts@@ -70,7 +70,7 @@ export async function downloadFile(throw new Error(error);}- const totalChunks = Math.ceil(size / chunkSize);+ const totalChunks = Math.ceil(size / (chunkSize + ABYTES));const decryptedLength = size - totalChunks * ABYTES;if (attachment && attachment.size !== decryptedLength) {diff --git a/apps/mobile/app/common/filesystem/utils.ts b/apps/mobile/app/common/filesystem/utils.tsindex 404dbd96b..6575587cb 100644--- a/apps/mobile/app/common/filesystem/utils.ts+++ b/apps/mobile/app/common/filesystem/utils.ts@@ -155,7 +155,7 @@ export async function checkUpload(expectedSize: number) {const size = await getUploadedFileSize(filename);- const totalChunks = Math.ceil(size / chunkSize);+ const totalChunks = Math.ceil(size / (chunkSize + ABYTES));const decryptedLength = size - totalChunks * ABYTES;const error =size === 0