mojoe
10 September 2022 14:09
1
The online help still says that attachments over 10 MB will crash the mobile app when syncing. I'm assuming that this is no longer true?
I just imported everything from Evernote into Joplin Desktop, setup encryption, then synced to my Android phone via Dropbox. I have many attachments larger than 10 MB. I was able to open several of them, including the largest (152 MB) on the phone.
2 Likes
The limit is 100mb, not 10. Even that isn't needed in my opinion
So resources ≤100 MB get synced? Why is it no longer needed?
Yes:
}
migrationHandler() {
if (this.migrationHandler_) return this.migrationHandler_;
this.migrationHandler_ = new MigrationHandler(this.api(), this.db(), this.lockHandler(), this.lockClientType(), this.clientId_);
return this.migrationHandler_;
}
maxResourceSize() {
if (this.maxResourceSize_ !== null) return this.maxResourceSize_;
return this.appType_ === AppType.Mobile ? 100 * 1000 * 1000 : Infinity;
}
public setShareService(v: ShareService) {
this.shareService_ = v;
}
public setEncryptionService(v: any) {
this.encryptionService_ = v;
}
The underlying bug has been fixed long ago, the limit is an extra precaution.
I see. Thanks for clarifying.
mojoe
11 September 2022 21:48
7
So, that 152 MB attachment that synced to my phone, and that I opened, must have been an illusion or a fluke.
Yeah, that's interesting. Could be a bug in this check I suppose
How about this threshold?
const done = await this.resizeImage(localFilePath, targetPath, mimeType);
if (!done) return;
} else {
if (fileType === 'image') {
dialogs.error(this, _('Unsupported image type: %s', mimeType));
return;
} else {
await shim.fsDriver().copy(localFilePath, targetPath);
const stat = await shim.fsDriver().stat(targetPath);
if (stat.size >= 10000000) {
await shim.fsDriver().remove(targetPath);
throw new Error('Resources larger than 10 MB are not currently supported as they may crash the mobile applications. The issue is being investigated and will be fixed at a later time.');
}
}
}
} catch (error) {
reg.logger().warn('Could not attach file:', error);
await dialogs.error(this, error.message);
return;
}
Forgot about this one! I think it can be removed too, there's no need to keep it.
However this limit only applies when attaching files on mobile. The original question was about a file attached elsewhere and synced to mobile.
system
Closed
12 October 2022 06:01
12
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.