Skip to content

Wire the app's connectivity log into a real Settings screen - #262

Merged
taylorcox75 merged 1 commit into
release/v3.8.45from
bugfix/connectivity-log-viewer
Sep 21, 2026
Merged

taylorcox75 merged 1 commit into
release/v3.8.45from
bugfix/connectivity-log-viewer

Conversation

@taylorcox75

Copy link
Copy Markdown
Owner

Summary

Settings → Advanced's "View Connectivity Logs" row was mislabeled — it opened app/(tabs)/logs.tsx, which is actually qBittorrent's own server-side application/peer log viewer (logs/main, logs/peers). That screen explicitly shows a "not connected" placeholder whenever the app isn't connected — exactly the moment a user needs a connectivity diagnostic. This came up in issue #256, where a user was pointed at "View Connectivity Logs" to diagnose a connection failure and got a dead end.

The app already captures a real HTTP/auth/connection diagnostic trail in services/connectivity-log.ts (an in-memory ring buffer fed by clogDebug/Info/Warn/Error calls throughout services/api/client.ts, services/server-manager.ts, context/ServerContext.tsx, etc.), but it was never wired to any screen — only ever shown buried inside SuperDebugPanel's "Run Full Diagnostic".

  • Repurposed components/LogViewer.tsx to read from services/connectivity-log.ts instead of the dead services/log-storage.ts. Fixed the timestamp conversion (connectivity log uses Date.now() ms, the old code multiplied by 1000 assuming epoch-seconds), mapped DEBUG/INFO/WARN/ERROR levels to theme colors, added each entry's tag (e.g. AUTH, HTTP, CONN) for context, and added a Copy action (expo-clipboard, mirroring app/server/[id].tsx's copyDebugInfo pattern) that copies formatConnectivityLog()'s output.
  • Settings → Advanced: renamed the old row to "Server Logs" (new i18n key viewServerLogs) since it's a legitimate separate feature, just mislabeled — still opens app/(tabs)/logs.tsx. Added a new "View Connectivity Logs" row (new i18n key viewConnectivityLogs) that opens the repurposed LogViewer modal directly, no live connection required. All six locales actually translated.
  • Deleted dead code (AGENTS.md Critical Rule 7): services/log-storage.ts, tests/services/log-storage.test.ts, and the no-op logStorage.autoDeleteIfNeeded() call in app/_layout.tsx — logStorage.storeLogs() was never called anywhere, so nothing ever populated it.
  • Tests: added tests/rn/components/LogViewer.test.tsx (none existed before) covering rendering, empty state, Clear, and Copy (success + failure toast).
  • AGENTS.md: corrected the app/(tabs)/logs.tsx File Index entry (it isn't "connectivity logs"), updated the LogViewer and connectivity-log.ts entries, and added a §10 Gotcha explaining the mislabeling for future sessions.

Related to #256 (does not close it — this fixes a support tool discovered while investigating that issue, not the underlying TLS-rejection diagnosis work).

Test plan

  • npx tsc --noEmit — exit 0
  • npm test — 1160 passed, 80 suites (includes new LogViewer.test.tsx and the locale parity suite)
  • npm run lint — 0 errors, 38 warnings (baseline was 37; the +1 is the same pre-existing react-hooks/set-state-in-effect pattern already present in CategoryModal.tsx/SavePathPickerModal.tsx, not a new class of issue)
  • npm run format — clean, no additional changes
  • Manual: build in Xcode, open Settings → Advanced, confirm "Server Logs" still opens the qBittorrent log screen and "View Connectivity Logs" opens the new modal with live entries, Copy and Clear working

🤖 Generated with Claude Code

Settings → Advanced's "View Connectivity Logs" row actually opened
qBittorrent's own server-side log viewer, which requires a live
connection and shows nothing on the failure the user is trying to
diagnose. Repurpose LogViewer to display services/connectivity-log.ts
(the app's own in-memory HTTP/auth/connection trail, already captured
but never surfaced) instead, add a Copy action, and rename the old row
to "Server Logs" since it's a legitimate separate feature, just
mislabeled. Delete services/log-storage.ts, which nothing populated.
@taylorcox75
taylorcox75 merged commit 102d098 into release/v3.8.45 Sep 21, 2026
1 check failed
@taylorcox75
taylorcox75 deleted the bugfix/connectivity-log-viewer branch September 21, 2026 01:23
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