Fixed for decoder dl speed and mobile warnings on low memory devices.

This commit is contained in:
Lucas Winther
2026-07-29 07:47:42 +02:00
parent 2643a446d0
commit 78e99fc415
7 changed files with 208 additions and 32 deletions
+11 -4
View File
@@ -52,11 +52,18 @@ export function isLikelyMobile(
/**
* Fraction of reported device RAM a single tab can safely peak at before
* mobile OSes intervene. Conservative on purpose — `deviceMemory` already
* caps at 8 regardless of actual RAM, and the tab competes with the rest of
* the OS, the browser process itself, and other open tabs.
* mobile OSes intervene.
*
* D-029: the original 0.5 was not conservative enough — `deviceMemory` is
* commonly 2-4 on ordinary (not just flagship) Android phones today, and at
* 0.5 that already yields a 1-2 GB "safe" budget, clearing every model in
* the catalog including Medium (~556 MB peak) and Large v3 Turbo (~762 MB) —
* silently skipping the warning for exactly the phones D-027's crash report
* was about. 0.1 keeps mid/low-end phones (deviceMemory ≤ 4) warned for
* Medium+ while still exempting genuine high-end devices (deviceMemory ≥ 6,
* 600+ MB budget) that have real headroom to spare.
*/
const SAFE_TAB_FRACTION_OF_DEVICE_MEMORY = 0.5;
const SAFE_TAB_FRACTION_OF_DEVICE_MEMORY = 0.1;
/**
* Fallback risk threshold when `deviceMemory` isn't reported (notably all of