fix(upload): increase attachment size limit to 50mb (#144)

* fix(upload): increase attachment size limit to 50mb

Raises body limits in web proxy and desktop app. Adds client-side size checks and better 413 error handling.

* fix(client): auto-compress large images to avoid server body limits

Adds client-side compression for images >1MB. Resizes to max 2048px and converts large PNGs to JPEG. Adds detailed logging for debugging.

* chore: remove debug logs from client and proxy
This commit is contained in:
Bohdan Triapitsyn
2026-01-14 13:23:17 +02:00
committed by GitHub
parent 5ffec2acba
commit c4fb9d5730
5 changed files with 83 additions and 7 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial};
#[cfg(target_os = "macos")]
static NEEDS_TRAFFIC_LIGHT_FIX: AtomicBool = AtomicBool::new(false);
const PROXY_BODY_LIMIT: usize = 32 * 1024 * 1024; // 32MB
const PROXY_BODY_LIMIT: usize = 50 * 1024 * 1024; // 50MB
const CLIENT_RELOAD_DELAY_MS: u64 = 800;
const MODELS_DEV_API_URL: &str = "https://models.dev/api.json";
const MODELS_METADATA_CACHE_TTL: Duration = Duration::from_secs(5 * 60);