diff --git a/ts/components/conversation/SessionConversation.tsx b/ts/components/conversation/SessionConversation.tsx
index c202e0c79..be0c5b4d6 100644
--- a/ts/components/conversation/SessionConversation.tsx
+++ b/ts/components/conversation/SessionConversation.tsx
@@ -408,7 +408,7 @@ export class SessionConversation extends React.Component<Props, State> {
         blob: file,
       });
 
-      if (blob.blob.size >= MAX_ATTACHMENT_FILESIZE_BYTES) {
+      if (blob.blob.size > MAX_ATTACHMENT_FILESIZE_BYTES) {
         ToastUtils.pushFileSizeErrorAsByte(MAX_ATTACHMENT_FILESIZE_BYTES);
         return;
       }
diff --git a/ts/data/dataInit.ts b/ts/data/dataInit.ts
index f838adfcc..71db245ab 100644
--- a/ts/data/dataInit.ts
+++ b/ts/data/dataInit.ts
@@ -113,6 +113,8 @@ export async function shutdown() {
 
   // No outstanding jobs, return immediately
   if (jobKeys.length === 0) {
+    window?.log?.info('data.shutdown: No outstanding jobs');
+
     return null;
   }
 
@@ -246,6 +248,8 @@ function removeJob(id: number) {
 
   if (_shutdownCallback) {
     const keys = Object.keys(jobs);
+    window?.log?.info(`removeJob: _shutdownCallback and we still have ${keys.length} jobs to run`);
+
     if (keys.length === 0) {
       _shutdownCallback();
     }
diff --git a/ts/models/message.ts b/ts/models/message.ts
index 2096133ee..e3072dde5 100644
--- a/ts/models/message.ts
+++ b/ts/models/message.ts
@@ -690,7 +690,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
       height: height || 0,
       path,
       fileName,
-      fileSize: size ? filesize(size) : null,
+      fileSize: size ? filesize(size, { base: 10 }) : null,
       isVoiceMessage: isVoiceMessageBool,
       pending: Boolean(pending),
       url: path ? getAbsoluteAttachmentPath(path) : '',
diff --git a/ts/session/constants.ts b/ts/session/constants.ts
index 72b546a9d..a6d71bf0d 100644
--- a/ts/session/constants.ts
+++ b/ts/session/constants.ts
@@ -41,9 +41,12 @@ export const CONVERSATION = {
   MAX_VOICE_MESSAGE_DURATION: 300,
   MAX_UNREAD_COUNT: 9999,
 };
-// Max attachment size: 6 MB
 
-export const MAX_ATTACHMENT_FILESIZE_BYTES = 6 * 1000 * 1000; // 6MB
+/**
+ * The file server and onion request max upload size is 10MB precisely.
+ * 10MB is still ok, but one byte more is not.
+ */
+export const MAX_ATTACHMENT_FILESIZE_BYTES = 10 * 1000 * 1000;
 
 export const VALIDATION = {
   MAX_GROUP_NAME_LENGTH: 30,
diff --git a/ts/session/crypto/BufferPadding.ts b/ts/session/crypto/BufferPadding.ts
index 6d3588df7..23931e9c7 100644
--- a/ts/session/crypto/BufferPadding.ts
+++ b/ts/session/crypto/BufferPadding.ts
@@ -1,3 +1,5 @@
+import { MAX_ATTACHMENT_FILESIZE_BYTES } from '../constants';
+
 /**
  * This file is used to pad message buffer and attachments
  */
@@ -73,10 +75,17 @@ export function addAttachmentPadding(data: ArrayBuffer): ArrayBuffer {
   const originalUInt = new Uint8Array(data);
   window?.log?.info('Adding attachment padding...');
 
-  const paddedSize = Math.max(
+  let paddedSize = Math.max(
     541,
     Math.floor(Math.pow(1.05, Math.ceil(Math.log(originalUInt.length) / Math.log(1.05))))
   );
+
+  if (
+    paddedSize > MAX_ATTACHMENT_FILESIZE_BYTES &&
+    originalUInt.length <= MAX_ATTACHMENT_FILESIZE_BYTES
+  ) {
+    paddedSize = MAX_ATTACHMENT_FILESIZE_BYTES;
+  }
   const paddedData = new ArrayBuffer(paddedSize);
   const paddedUInt = new Uint8Array(paddedData);
 
diff --git a/ts/test/session/unit/padding/Padding_test.ts b/ts/test/session/unit/padding/Padding_test.ts
index 783fe6b60..17828955e 100644
--- a/ts/test/session/unit/padding/Padding_test.ts
+++ b/ts/test/session/unit/padding/Padding_test.ts
@@ -10,6 +10,7 @@ import {
   getUnpaddedAttachment,
   removeMessagePadding,
 } from '../../../../session/crypto/BufferPadding';
+import { MAX_ATTACHMENT_FILESIZE_BYTES } from '../../../../session/constants';
 chai.use(chaiAsPromised as any);
 chai.should();
 
@@ -30,6 +31,41 @@ describe('Padding', () => {
       );
     });
 
+    it('no padding if attachment has the max size', () => {
+      //if the attachment is already of the max size, we do not pad it more
+      const bufferIn = new Uint8Array(MAX_ATTACHMENT_FILESIZE_BYTES);
+      const paddedBuffer = addAttachmentPadding(bufferIn);
+      expect(paddedBuffer.byteLength).to.equal(MAX_ATTACHMENT_FILESIZE_BYTES);
+      expect(new Uint8Array(paddedBuffer)).to.equalBytes(bufferIn);
+    });
+
+    it('add padding is limited to max attachment size', () => {
+      // there is only enough room to add one byte as padding.
+      const bufferIn = new Uint8Array(MAX_ATTACHMENT_FILESIZE_BYTES - 1);
+      const paddedBuffer = addAttachmentPadding(bufferIn);
+      expect(paddedBuffer.byteLength).to.equal(MAX_ATTACHMENT_FILESIZE_BYTES);
+      expect(new Uint8Array(paddedBuffer.slice(0, bufferIn.length))).to.equalBytes(bufferIn);
+      // this makes sure that the padding is just the 0 bytes
+      expect(paddedBuffer.slice(bufferIn.length).byteLength).to.eq(1);
+      expect(new Uint8Array(paddedBuffer.slice(bufferIn.length))).to.equalBytes(
+        new Uint8Array([0])
+      );
+    });
+
+    it('add padding if the attachment is already too big', () => {
+      // we just want to make sure we do not overide attachment data. The file upload will fail, but at least make sure to keep the user data.
+      const bufferIn = new Uint8Array(MAX_ATTACHMENT_FILESIZE_BYTES + 1);
+      const paddedBuffer = addAttachmentPadding(bufferIn);
+      const expectedPaddedSize = Math.floor(
+        Math.pow(1.05, Math.ceil(Math.log(bufferIn.length) / Math.log(1.05)))
+      );
+      expect(new Uint8Array(paddedBuffer.slice(0, bufferIn.length))).to.equalBytes(bufferIn);
+      // this makes sure that the padding is just the 0 bytes
+      expect(new Uint8Array(paddedBuffer.slice(bufferIn.length))).to.equalBytes(
+        new Uint8Array(expectedPaddedSize - bufferIn.length)
+      );
+    });
+
     it('remove padding', () => {
       // padding can be anything after the expected size
       const expectedSize = 10;