Introduce smaller incoming size limit for text attachments

This commit is contained in:
Scott Nonnenberg
2023-12-18 10:14:59 -08:00
committed by GitHub
parent 8c71ed2590
commit 5e733059b9
7 changed files with 85 additions and 31 deletions
+16
View File
@@ -43,6 +43,22 @@ export const getMaximumIncomingAttachmentSizeInKb = (
}
};
export const getMaximumIncomingTextAttachmentSizeInKb = (
getValue: typeof RemoteConfig.getValue
): number => {
try {
return (
parseIntOrThrow(
getValue('global.textAttachmentLimitBytes'),
'getMaximumIncomingTextAttachmentSizeInKb'
) / KIBIBYTE
);
} catch (_error) {
// TODO: DESKTOP-6314. We're not gonna log until the new flag is fully deployed
return KIBIBYTE * 5;
}
};
export function getRenderDetailsForLimit(limitKb: number): {
limit: number;
units: string;