Skip to content

v3.8.44: root folder param, proxy cookies, cold-launch timeout, retries=0, quick-switch flash - #248

Merged
taylorcox75 merged 1 commit into
mainfrom
bugfix/connection
Sep 10, 2026
Merged

taylorcox75 merged 1 commit into
mainfrom
bugfix/connection

Conversation

@taylorcox75

Copy link
Copy Markdown
Owner

Summary

  • Fixed: "Create root folder" toggle in the add-torrent dialog was a silent no-op on every supported server — qBittorrent has ignored the root_folder parameter on torrents/add since 4.3.2 (WebAPI 2.7.0). Switched to the real contentLayout parameter, gated by a new ApiFeatures.useContentLayoutAddParam. Toggle ON still sends nothing (server default — unchanged behavior for every current user); only toggling OFF now sends contentLayout=NoSubfolder. Verified against qBittorrent's torrentscontroller.cpp source at the 4.6.0 and 5.0.0 tags, not just the wiki (which still documents the dead parameter).
  • Fixed: losing the login session behind reverse proxies that set their own cookies (Cloudflare __cf_bm, Authelia/Traefik forward-auth, etc.) — the client now merges Set-Cookie values into the jar by cookie name instead of replacing it wholesale, so a proxy-issued cookie can no longer silently drop the qBittorrent SID cookie and force an unnecessary re-login.
  • Fixed: connection timeout / retry-attempts preferences being ignored on the very first cold-launch connect attempt.
  • Fixed: a saved retryAttempts of 0 always getting coerced back to 3 on launch (an || 3 fallback also caught the legitimate value 0). Extracted a shared resolveConnectionSettings() helper used by both cold-start call sites so they can't drift again.
  • Fixed: a loading skeleton flashing on every foreground return, even a quick app-switch — TorrentContext/TransferContext now only run the full recovery dance when backgrounded 10s or more; a shorter background just nudges an incremental refresh.
  • Maintenance: connecting to a server is slightly faster — application.ts's getVersion now fetches app/version and app/webapiVersion concurrently instead of sequentially.
  • Bumped to v3.8.44 (v3.8.43 already shipped 2026-09-07) with a matching changelog entry, and updated AGENTS.md (File Index + a new Gotchas entry on the root_folder/contentLayout wiki drift).

Compatibility

No stored preference key, ServerConfig field, or colors key was added, renamed, or repurposed. The root-folder fix specifically preserves "toggle ON = server default" as the behavior every existing user already has today; only turning it OFF changes anything, and only on WebAPI ≥ 2.7 (qBit 4.3.2+) — older servers keep getting the legacy root_folder field unchanged.

Test plan

  • npx tsc --noEmit — exit 0
  • npm test — 78 suites / 1104 tests passing (both projects)
  • npm run lint — 0 errors, 37 warnings (documented baseline)
  • npm run format — no changes needed
  • Manual verification recommended on device before merge:
    • Add a multi-file torrent with "Create root folder" OFF on a qBit 5.x server → files land without a wrapper folder. With it ON → identical layout to today.
    • Settings → Advanced → Retry Attempts = 0, kill and relaunch → connectivity log shows no "Retrying request" lines on a failing request.
    • Background the app ~3s and return → no skeleton flash; background ≥15s → skeleton as before.
    • If available, a reverse-proxy setup (Cloudflare/forward-auth) that sets its own cookie → leave the app open >30 min, confirm no unexpected re-login entries in the connectivity log.

Note: pushing this branch's merge to main will trigger the App Store build (easBuild: true in package.json) — not part of this PR, that's a separate step.

🤖 Generated with Claude Code

…es=0, quick-switch flash

- Fix "Create root folder" toggle being a silent no-op: torrents/add's
  root_folder parameter has been dropped by qBittorrent since 4.3.2 (WebAPI
  2.7.0); switch to contentLayout, gated by the new
  ApiFeatures.useContentLayoutAddParam. ON keeps sending nothing (server
  default, unchanged behavior for every existing user); only OFF now sends
  contentLayout=NoSubfolder. Legacy root_folder param preserved for WebAPI < 2.7.
- Fix losing the session behind reverse proxies that set their own cookies
  (Cloudflare __cf_bm, forward-auth, etc.): client.ts now merges Set-Cookie
  values into the jar by name instead of replacing it wholesale, so a
  proxy-issued cookie can no longer silently drop the qBittorrent SID cookie.
- Fix connection timeout/retry preferences being ignored on the very first
  cold-launch connect attempt (ServerContext's auto-connect effect now applies
  them before firing, not just RootLayout's effect which ran too late).
- Fix retryAttempts=0 always being coerced back to 3 via `|| 3`; extracted a
  shared resolveConnectionSettings() helper used by both cold-start call sites.
- Fix a loading skeleton flashing on every foreground return, even a quick
  app-switch: TorrentContext/TransferContext now only run the full recovery
  dance when backgrounded >= LONG_BACKGROUND_THRESHOLD_MS (10s, extracted to
  constants/timing.ts), otherwise just nudge an incremental refresh.
- Faster connect: application.ts's getVersion fetches app/version and
  app/webapiVersion concurrently instead of sequentially.
- Bump to 3.8.44 (3.8.43 already shipped 2026-09-07) and update AGENTS.md
  (File Index + a Gotchas entry on the root_folder/contentLayout wiki drift).

No stored preference, ServerConfig field, or colors key was added, renamed,
or repurposed by any of the above.
@taylorcox75
taylorcox75 merged commit 720fb94 into main Sep 10, 2026
3 of 4 checks passed
@taylorcox75
taylorcox75 deleted the bugfix/connection branch September 10, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant