TL;DR
- Fixes #760 -- enabling SmartProxy at runtime now resumes downloads that had failed with MEGA
-17EOVERQUOTA. The runtime-enable plumbing that landed in v8.44 only covered the HTTP 509 path. Real-world quota traffic on anonymous link downloads actually comes back as HTTP 200 with a JSON body of-17, and that path was lobbing the exception straight up before SmartProxy ever got consulted. Two interlocking changes here close it for good. - Implements #759 -- "Refresh SmartProxy list now" button surfaced in the main Downloads tab. The same action already existed inside the Settings dialog's SmartProxy tab from v8.44; the user reasonably did not want to dig into Settings every time the pool went stale.
- i18n: one new bundle key (
refresh_smartproxy_list_now) in every locale. Tooltip reuses the v8.44 key, so DE/HU/TR/VI/ZH inherit the same translation already audited by #397 contributors.
New in 8.46
#760 -- MEGA -17 EOVERQUOTA + SmartProxy
-
MegaAPI.RAW_REQUEST: route-17through SmartProxy instead of throwing. When MEGA's bandwidth quota for an anonymous link download is exhausted,/csreturns HTTP 200 with a JSON body of[-17].RAW_REQUESTtranslated that intoMegaAPIException(-17)immediately, before the SmartProxy enable condition (http_error == 509) could ever match. The exception bubbled toDownload.getMegaFileDownloadUrl-> FATAL ->stopDownloader-> 60 sRESTART_COUNTDOWN_SECS_OVERQUOTA->restart()->/cs->-17again, in a loop, with the proxy pool never engaged. Fixed: whenmega_error == -17AND SmartProxy is enabled AND there is no static HTTP proxy in the way, synthesisehttp_error = 509, drop the parsed body, bumpconta_errorby hand (the natural exp-backoff branch is gated onhttp_error != 509and would otherwise leave the counter at zero), and let the existing routing condition pick a proxy for the next iteration. Bounded byMAX_RAW_REQUEST_RETRIES(30) so an account-scoped-17or a genuinely dead pool still throws within reasonable time. -
Download.wakeFromRetryCountdown()+ countdown lifecycle flags. The v8.44wakeFromBackoffpath only reached downloads with active chunk workers. Two failure shapes were left orphaned:- Download already in cleanup countdown (
stopDownloaderfired, 60 s sleep beforerestart()). - Download that failed in
provisionIt(e.g.getMegaFileMetadatathrew-17) and went straight tofinished_queuewith no countdown lambda attached at all.
Restructured the cleanup countdown into a
try/finallythat maintains a new_retry_countdown_activevolatile flag, and routed both natural completion and external wakeups through a single_tryRestart()dispatcher whoseAtomicBoolean _restart_triggeredCAS guarantees at-most-oncerestart()per Download instance.wakeFromRetryCountdown()branches on the flag: countdown active -> set the wake flag, the tick loop breaks the sleep and calls_tryRestart()itself; no countdown active -> evaluate_status_error != null && !_canceled && !_closed && _auto_retry_on_error(the same predicate the run cleanup uses) and call_tryRestart()directly. Closed / cancelled /-16-FILE_BLOCKED / completed downloads stay put. - Download already in cleanup countdown (
-
MainPanelView.settings_menuActionPerformed: iterate finished_queue too. After enabling SmartProxy, in addition to the v8.44 running-listwakeFromBackoff()pass, now also iteratefinished_queueand callwakeFromRetryCountdown()on every Download. Combined with the MegaAPI-side-17-as-synthetic-509 escalation, this is what delivers the user-visible "downloads start again right after I enable SmartProxy" promise of #758 for the JSON-body quota case, not just the HTTP 509 case.
#759 -- Refresh button in the main Downloads tab
-
New
refresh_smartproxy_buttoninMainPanelView. Sits in the bottom button row of the Downloads tab betweenglobal_speed_down_labelandforce_chunk_reset_button. Visibility tracksMainPanel.isUse_smart_proxy()exactly likeforce_chunk_reset_button, so the row stays clean when SmartProxy is OFF. Click handler offloadsSmartMegaProxyManager.refreshProxyList()toTHREAD_POOLbecause the call does HTTP I/O against the configured#URLfeeds and would freeze the EDT for seconds on an unreachable feed; the button is disabled for the duration and re-enabled in afinallyblock viaGUIRun. Back-to-back clicks collapse on the manager's existingsynchronizedmonitor insiderefreshProxyList. The same action is still available inside Settings -> SmartProxy tab, exactly as v8.44 shipped it. -
The "compact proxy-list textarea" half of #759 was already addressed by v8.44's
setRows(3)change, so no further work was needed there.
i18n
One new key in every bundle: refresh_smartproxy_list_now. EN/ES/IT/DE/HU/TR/VI/ZH localised; the DE/HU/TR/VI/ZH translations are best-effort and refinable via #397. Tooltip reuses the existing ui.smartproxy.refresh_now.tooltip key from v8.44 instead of duplicating the description.