Skip to content

fix(network): avoid guessing TLS failures from the URI scheme - #241

Merged
thisisgm merged 2 commits into
thisisgm:mainfrom
GreyforgeLabs:fix/network-failure-diagnosis
Oct 13, 2026
Merged

thisisgm merged 2 commits into
thisisgm:mainfrom
GreyforgeLabs:fix/network-failure-diagnosis

Conversation

@GreyforgeLabs

@GreyforgeLabs GreyforgeLabs commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

A failed WebDAV or FTP connection currently reports a TLS-handshake failure solely from its URI scheme, including plain HTTP WebDAV and FTP. Other schemes are always labeled authentication failures. The helper suppresses GIO output, so its ordinary nonzero exit status establishes neither diagnosis.

Use a neutral connection-failed sentence for unclassified exits. Preserve the explicit timeout and unavailable-helper messages, remove the unused URI argument at the call site, and update the existing UI expectation. The message exposes no URI, credentials or backend output. This deliberately makes no new attempt to infer authentication or TLS errors without evidence from the helper.

Validation: 28 new checks fail before the fix; ./tests/js.sh errors passes all 97 checks afterward. The complete JavaScript battery passes (5,632 main checks plus 4 Edmonton and 13 DST checks). Headless tests/network-keyless.sh and tests/network-open-share.sh pass with an isolated fixture root. The file-budget check passes. The display-dependent networkauth case was updated but not run.

Partially addresses #238. This fixes the unsupported diagnosis, but does not complete that issue's request for evidence-based authentication/TLS classification and sanitized backend details. Those require a diagnostic channel from the currently silent helper; #238 should remain open for that work. The existing credential-retry state policy is unchanged.

Review note: CodeRabbit's Biome integration could not parse the repository's Qt-specific .import and .pragma directives. The Qt JavaScript runner above validates these files; Biome did not provide a lint result.

Summary by CodeRabbit

  • Bug Fixes
    • Connection failures now show a consistent network-location error across supported and invalid addresses, rather than varying the message based on connection type.
    • Failure messages no longer include credential-bearing addresses.
    • Timeout and unavailable authentication-helper errors continue to show their specific messages.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6cc21b3a-7cbe-41d6-b4d2-45c7004e89bc

📥 Commits

Reviewing files that changed from the base of the PR and between 7a5a343 and 10bab6c.

📒 Files selected for processing (2)
  • tests/js/errors.js
  • ui/js/Errors.js

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: df17f90a-2dea-467c-8e48-88f749aedc77

📥 Commits

Reviewing files that changed from the base of the PR and between 58fc89f and 7a5a343.

📒 Files selected for processing (4)
  • tests/js/errors.js
  • tests/ui.sh
  • ui/NetworkMounts.qml
  • ui/js/Errors.js

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The connection failure message mapping no longer uses the URI scheme to classify unspecified failures. The caller passes only the exit code. Tests cover generic failures, timeout, unavailable helpers, and credential-bearing URIs.

Changes

Connection failure reporting

Layer / File(s) Summary
Map connection failure exit codes
ui/js/Errors.js, ui/NetworkMounts.qml, tests/js/errors.js, tests/ui.sh
connectFailure now accepts only an exit code. Exit codes 124, 126, and 127 retain specific messages; other codes use a neutral network-location failure message. Tests cover the revised messages and verify that a credential-bearing URI is not echoed.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to 7a5a3

Unclassified connection failures now show a neutral message instead of a possibly wrong TLS or authentication diagnosis, and URIs are no longer passed to the formatter. No new merge-blocking risk was found.

🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #238 requires authentication and TLS failures to be distinguished when backend evidence is available. It also requires sanitized backend details to be available. This PR removes URI-based TLS cl… Use available, sanitized backend evidence to distinguish authentication failures from TLS failures. Make sanitized backend details available to the failure path. Add automated coverage for authentication refusal, actual TLS failure, and the…
Docstring Coverage ❓ Inconclusive Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (2 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changes are limited to ui/js/Errors.js, ui/NetworkMounts.qml, and related tests. They remove the URI-based diagnosis described by issue #238 and update regression expectations. No unrelated be…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing TLS-failure guesses based on the URI scheme.
Full details: Linked Issues check

Explanation

Issue #238 requires authentication and TLS failures to be distinguished when backend evidence is available. It also requires sanitized backend details to be available. This PR removes URI-based TLS classification and returns a neutral message for unclassified exits, while preserving timeout and unavailable-helper messages. However, ui/NetworkMounts.qml now passes only the exit code, and ui/js/Errors.js has no authentication or TLS mapping and exposes no sanitized backend details. The updated tests verify the neutral result and preserved special cases, but they do not establish the missing distinctions or details.

Resolution

Use available, sanitized backend evidence to distinguish authentication failures from TLS failures. Make sanitized backend details available to the failure path. Add automated coverage for authentication refusal, actual TLS failure, and the exposed sanitized details, while retaining coverage for timeout, unavailable helper, unknown failure, and plain HTTP WebDAV.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (2 skipped: 1 unsupported, 1 too large.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thisisgm
thisisgm merged commit d4529f2 into thisisgm:main Oct 13, 2026
1 check passed
@thisisgm

Copy link
Copy Markdown
Owner

merged as authored; a connection failure is no longer reported as a TLS handshake failure guessed from the address (10bab6c, v0.3.10). Thanks @GreyforgeLabs! https://github.com/thisisgm/flea/releases/tag/v0.3.10

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.

2 participants