github tonikelope/megabasterd v8.46
MegaBasterd 8.46

6 hours ago

TL;DR

  • Fixes #760 -- enabling SmartProxy at runtime now resumes downloads that had failed with MEGA -17 EOVERQUOTA. 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 -17 through SmartProxy instead of throwing. When MEGA's bandwidth quota for an anonymous link download is exhausted, /cs returns HTTP 200 with a JSON body of [-17]. RAW_REQUEST translated that into MegaAPIException(-17) immediately, before the SmartProxy enable condition (http_error == 509) could ever match. The exception bubbled to Download.getMegaFileDownloadUrl -> FATAL -> stopDownloader -> 60 s RESTART_COUNTDOWN_SECS_OVERQUOTA -> restart() -> /cs -> -17 again, in a loop, with the proxy pool never engaged. Fixed: when mega_error == -17 AND SmartProxy is enabled AND there is no static HTTP proxy in the way, synthesise http_error = 509, drop the parsed body, bump conta_error by hand (the natural exp-backoff branch is gated on http_error != 509 and would otherwise leave the counter at zero), and let the existing routing condition pick a proxy for the next iteration. Bounded by MAX_RAW_REQUEST_RETRIES (30) so an account-scoped -17 or a genuinely dead pool still throws within reasonable time.

  • Download.wakeFromRetryCountdown() + countdown lifecycle flags. The v8.44 wakeFromBackoff path only reached downloads with active chunk workers. Two failure shapes were left orphaned:

    • Download already in cleanup countdown (stopDownloader fired, 60 s sleep before restart()).
    • Download that failed in provisionIt (e.g. getMegaFileMetadata threw -17) and went straight to finished_queue with no countdown lambda attached at all.

    Restructured the cleanup countdown into a try/finally that maintains a new _retry_countdown_active volatile flag, and routed both natural completion and external wakeups through a single _tryRestart() dispatcher whose AtomicBoolean _restart_triggered CAS guarantees at-most-once restart() 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.

  • MainPanelView.settings_menuActionPerformed: iterate finished_queue too. After enabling SmartProxy, in addition to the v8.44 running-list wakeFromBackoff() pass, now also iterate finished_queue and call wakeFromRetryCountdown() 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_button in MainPanelView. Sits in the bottom button row of the Downloads tab between global_speed_down_label and force_chunk_reset_button. Visibility tracks MainPanel.isUse_smart_proxy() exactly like force_chunk_reset_button, so the row stays clean when SmartProxy is OFF. Click handler offloads SmartMegaProxyManager.refreshProxyList() to THREAD_POOL because the call does HTTP I/O against the configured #URL feeds and would freeze the EDT for seconds on an unreachable feed; the button is disabled for the duration and re-enabled in a finally block via GUIRun. Back-to-back clicks collapse on the manager's existing synchronized monitor inside refreshProxyList. 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.

Don't miss a new megabasterd release

NewReleases is sending notifications on new releases.