Skip to content

NXDRIVE-3117: Direct transfer Web UI icon doesn't work for a target that has spaces in its name#6346

Open
gitofanindya wants to merge 10 commits into
masterfrom
wip-NXDRIVE-3117-direct-transfer-web-ui-icon-doesnt-work-for-a-target-that-has-spaces-in-its-name
Open

NXDRIVE-3117: Direct transfer Web UI icon doesn't work for a target that has spaces in its name#6346
gitofanindya wants to merge 10 commits into
masterfrom
wip-NXDRIVE-3117-direct-transfer-web-ui-icon-doesnt-work-for-a-target-that-has-spaces-in-its-name

Conversation

@gitofanindya
Copy link
Copy Markdown
Collaborator

@gitofanindya gitofanindya commented Apr 13, 2026

…hat has spaces in its name

Summary by Sourcery

Decode direct transfer URLs to correctly handle remote paths containing URL-encoded characters and document the associated change.

Bug Fixes:

  • Fix direct transfer Web UI behavior when the target path contains spaces or other URL-encoded characters.

Documentation:

  • Update 7.0.0 changelog to reference NXDRIVE-3117 and describe the direct transfer Web UI fix.

Copilot AI review requested due to automatic review settings April 13, 2026 09:35
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 13, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Fixes parsing of Direct Transfer protocol URLs whose target path contains spaces by decoding URL-encoded characters, and updates the 7.0.0 changelog entry to reference NXDRIVE-3117 and describe the issue accurately.

Flow diagram for Direct Transfer protocol URL parsing with URL decoding

flowchart TD
    A[Direct_Transfer_icon_clicked_in_Web_UI] --> B[Browser_opens_nxdrive_protocol_URL]
    B --> C[parse_protocol_url_receives_url_string]
    C --> D[Detect_Direct_Transfer_command_and_extract_remote_path_with_regex]
    D --> E[Decode_URL_encoded_characters_in_remote_path_using_unquote]
    E --> F[Return_parsed_data_with_command_and_decoded_remote_path]
    F --> G[NX_Drive_uses_remote_path_even_if_it_contains_spaces]
Loading

File-Level Changes

Change Details Files
Decode URL-encoded remote paths when parsing Direct Transfer protocol URLs so targets with spaces work correctly.
  • After extracting the remote_path from the incoming URL, apply urllib.parse.unquote to decode percent-encoded characters such as %20 into spaces.
  • Document the intent and safety of decoding (including handling of literal %20, which would be encoded as %2520) via inline comments near the parsing logic.
nxdrive/utils.py
Align changelog entry with the new Jira ticket and bug description for the Direct Transfer spaces-in-name issue.
  • Update the Direct Transfer section in the 7.0.0 release notes to reference Jira issue NXDRIVE-3117 instead of NXDRIVE-3.
  • Clarify the changelog line to mention that the Web UI icon did not work when the target contained spaces in its name.
docs/changes/7.0.0.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider limiting unquote to the path component only (e.g., via urlparse) to avoid unintentionally decoding query strings or fragments if those are ever appended to the protocol URL.
  • It may be worth adding a brief comment or assertion about the expected form of url_string (e.g., whether it can already be decoded or contain %2520), so future maintainers understand why a single unquote is considered safe here.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider limiting `unquote` to the path component only (e.g., via `urlparse`) to avoid unintentionally decoding query strings or fragments if those are ever appended to the protocol URL.
- It may be worth adding a brief comment or assertion about the expected form of `url_string` (e.g., whether it can already be decoded or contain `%2520`), so future maintainers understand why a single `unquote` is considered safe here.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.90%. Comparing base (787159e) to head (e862023).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
nxdrive/utils.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6346      +/-   ##
==========================================
+ Coverage   85.88%   85.90%   +0.01%     
==========================================
  Files          96       96              
  Lines       16517    16519       +2     
==========================================
+ Hits        14185    14190       +5     
+ Misses       2332     2329       -3     
Flag Coverage Δ
functional 63.96% <66.66%> (+0.04%) ⬆️
integration 28.22% <33.33%> (-0.01%) ⬇️
unit 61.17% <66.66%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Direct Transfer protocol URL handling for Web UI targets whose names include URL-encoded characters (notably spaces), so the correct remote folder can be preselected in the Direct Transfer dialog.

Changes:

  • Decode the extracted Web UI remote_path in parse_protocol_url() using urllib.parse.unquote().
  • Update the 7.0.0 changelog entry to reference NXDRIVE-3117 with the correct description.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
nxdrive/utils.py Decodes URL-encoded characters in Web UI direct-transfer remote_path before returning it.
docs/changes/7.0.0.md Adds the NXDRIVE-3117 entry under Direct Transfer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nxdrive/utils.py Outdated
Comment on lines +925 to +927
# Decode URL-encoded characters (e.g., %20 -> space)
# Note: literal %20 in folder names would be encoded as %2520, so this is safe
remote_path = unquote(remote_path)
Comment thread nxdrive/utils.py Outdated
Comment on lines 925 to 928
# Decode URL-encoded characters (e.g., %20 -> space)
# Note: literal %20 in folder names would be encoded as %2520, so this is safe
remote_path = unquote(remote_path)
return {
Copilot AI review requested due to automatic review settings April 13, 2026 11:15
@gitofanindya gitofanindya force-pushed the wip-NXDRIVE-3117-direct-transfer-web-ui-icon-doesnt-work-for-a-target-that-has-spaces-in-its-name branch from bea2e91 to 5cf5373 Compare April 13, 2026 11:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the nxdrive://direct-transfer/... Web UI protocol handler so remote target paths containing URL-encoded characters (notably spaces encoded as %20) are properly decoded before being used by the Direct Transfer UI, and documents the fix in the 7.0.0 changelog.

Changes:

  • Decode the extracted Web UI remote_path via urllib.parse.unquote() when handling direct-transfer protocol URLs.
  • Update the 7.0.0 changelog entry to reference NXDRIVE-3117 and describe the issue/fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
nxdrive/utils.py Decodes URL-encoded characters in remote_path for Web UI direct-transfer protocol URLs.
docs/changes/7.0.0.md Documents the NXDRIVE-3117 Direct Transfer Web UI fix in the 7.0.0 changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nxdrive/utils.py
gitofanindya and others added 3 commits April 13, 2026 16:49
…k-for-a-target-that-has-spaces-in-its-name' of https://github.com/nuxeo/nuxeo-drive into wip-NXDRIVE-3117-direct-transfer-web-ui-icon-doesnt-work-for-a-target-that-has-spaces-in-its-name
Copilot AI review requested due to automatic review settings April 13, 2026 11:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Windows handling of nxdrive://direct-transfer/... URLs originating from the Web UI by decoding URL-encoded characters in the extracted remote path, ensuring targets with spaces (and other encoded chars) resolve correctly. Adds focused unit tests and updates the 7.0.0 changelog entry.

Changes:

  • Decode remote_path via urllib.parse.unquote() for direct-transfer Web UI protocol URLs on Windows.
  • Add unit tests covering %20 decoding, %2520 preserving literal %20, and non-Windows no-decoding behavior.
  • Update docs/changes/7.0.0.md to reference NXDRIVE-3117.

Reviewed changes

Copilot reviewed 4 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
nxdrive/utils.py Decode Web UI direct-transfer remote_path on Windows to support spaces/URL-encoded characters.
tests/unit/test_utils.py Add OS-specific tests validating decoding behavior for direct-transfer Web UI URLs.
docs/changes/7.0.0.md Document NXDRIVE-3117 in the 7.0.0 changelog.
nxdrive/updater/__init__.py Docstring formatting cleanup.
nxdrive/osi/darwin/pyNotificationCenter.py Docstring formatting cleanup.
nxdrive/logging_config.py Docstring formatting cleanup.
nxdrive/gui/folders_loader.py Minor unicode escape formatting change in an error label.
nxdrive/gui/application.py Docstring formatting cleanup.
nxdrive/console.py Docstring formatting cleanup.
nxdrive/commandline.py Docstring formatting cleanup.
nxdrive/client/local/windows.py Docstring formatting cleanup.
nxdrive/client/local/linux.py Docstring formatting cleanup.
nxdrive/client/local/darwin.py Docstring formatting cleanup.
nxdrive/client/local/base.py Docstring formatting cleanup.
nxdrive/client/local/__init__.py Docstring formatting cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 13, 2026 12:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes NXDRIVE-3117 by ensuring nxdrive://direct-transfer/... Web UI protocol URLs correctly resolve remote targets whose paths contain URL-encoded characters (notably spaces) on Windows, and records the change in the 7.0.0 changelog. The PR also includes a handful of formatting/cleanup changes (docstrings and test data literals) that don’t alter behavior.

Changes:

  • Decode URL-encoded remote paths for direct-transfer Web UI protocol URLs on Windows (%20 → space; %2520 → literal %20).
  • Add unit tests covering Windows decoding behavior and non-Windows no-decoding behavior.
  • Update the 7.0.0 changelog entry for NXDRIVE-3117; minor formatting cleanups across tests/docs.

Reviewed changes

Copilot reviewed 9 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
nxdrive/utils.py Decode remote_path via urllib.parse.unquote() for Web UI direct-transfer URLs on Windows.
tests/unit/test_utils.py Adds unit tests validating decoding behavior (Windows) and preservation (non-Windows).
docs/changes/7.0.0.md Documents the NXDRIVE-3117 fix in the 7.0.0 changelog.
nxdrive/gui/folders_loader.py No functional change; normalizes Unicode escape casing in an error placeholder label.
tests/integration/windows/utils.py Refactors a debug print() string concatenation for readability (no behavior change).
tests/functional/test_remote_watcher.py Replaces eval()-built structures with explicit dict literals (safer/clearer test data).
tests/functional/test_remote_client.py Cleans up token string literals (line continuation removal; no behavior change).
tools/scripts/slow_thread_detection.py Docstring formatting cleanup.
tests/unit/gui/test_folders_treeview.py Removes an extraneous blank line.
tests/unit/gui/__init__.py Docstring formatting cleanup.
tests/old_functional/test_local_changes_when_offline.py Fixes/normalizes module docstring quoting/formatting.
tests/old_functional/common.py Docstring formatting cleanup.
nxdrive/updater/__init__.py Docstring formatting cleanup.
nxdrive/osi/darwin/pyNotificationCenter.py Docstring formatting cleanup.
nxdrive/logging_config.py Docstring formatting cleanup.
nxdrive/gui/application.py Docstring formatting cleanup (no protocol-handling logic changes in this diff).
nxdrive/console.py Docstring formatting cleanup.
nxdrive/commandline.py Docstring formatting cleanup.
nxdrive/client/local/windows.py Docstring formatting cleanup.
nxdrive/client/local/linux.py Docstring formatting cleanup.
nxdrive/client/local/darwin.py Docstring formatting cleanup.
nxdrive/client/local/base.py Docstring formatting cleanup.
nxdrive/client/local/__init__.py Docstring formatting cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 13, 2026 12:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the Windows direct-transfer “Web UI icon” flow by decoding URL-encoded remote paths (e.g., %20 → space) when parsing nxdrive://direct-transfer/... URLs, and adds regression tests plus changelog entry. The remainder of the PR is largely formatting/cleanup (docstrings, test fixtures, and removing eval() in tests) that supports maintainability and test safety.

Changes:

  • Decode URL-encoded characters for direct-transfer Web UI protocol URLs on Windows.
  • Add unit tests covering decoding behavior (including %2520 → literal %20) and non-Windows behavior.
  • Update 7.0.0 changelog and apply various small formatting/cleanup adjustments (including replacing eval() with dict literals in tests).

Reviewed changes

Copilot reviewed 12 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
nxdrive/utils.py Decode direct-transfer Web UI remote paths on Windows via unquote().
tests/unit/test_utils.py Add targeted tests for Windows decoding and non-Windows no-decoding.
docs/changes/7.0.0.md Document NXDRIVE-3117 fix in the 7.0.0 changelog.
tests/functional/test_remote_watcher.py Replace eval()-based test data with explicit dict literals for safer tests.
tests/integration/windows/utils.py Normalize multi-line debug print() formatting.
tests/unit/test_pytest_random.py Formatting-only updates to embedded test source strings.
tests/unit/test_commandline.py Formatting-only updates to multi-line strings written to INI files.
tests/unit/gui/test_folders_treeview.py Remove stray blank line (formatting cleanup).
tests/unit/gui/__init__.py Docstring formatting cleanup.
tests/old_functional/common.py Docstring formatting cleanup.
tests/old_functional/test_local_changes_when_offline.py Fix malformed opening docstring delimiter.
tests/functional/test_remote_client.py Formatting-only updates to token strings (remove line continuations).
nxdrive/gui/folders_loader.py Minor unicode escape formatting change (no behavioral impact).
nxdrive/gui/application.py Docstring formatting cleanup.
nxdrive/commandline.py Docstring formatting cleanup.
nxdrive/console.py Docstring formatting cleanup.
nxdrive/logging_config.py Docstring formatting cleanup.
nxdrive/updater/__init__.py Docstring formatting cleanup.
nxdrive/osi/darwin/pyNotificationCenter.py Docstring formatting cleanup.
nxdrive/client/local/__init__.py Docstring formatting cleanup.
nxdrive/client/local/base.py Docstring formatting cleanup.
nxdrive/client/local/darwin.py Docstring formatting cleanup.
nxdrive/client/local/linux.py Docstring formatting cleanup.
nxdrive/client/local/windows.py Docstring formatting cleanup.
tools/scripts/slow_thread_detection.py Docstring formatting cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Direct Transfer Web UI protocol handling so that URL-encoded remote paths (notably spaces) are decoded on Windows, ensuring the target folder is correctly selected/used when launched from the browser.

Changes:

  • Decode URL-encoded characters in nxdrive://direct-transfer/.../nuxeo/... remote paths on Windows.
  • Add unit tests covering decoding behavior (Windows) and non-decoding behavior (non-Windows) for Web UI direct-transfer URLs.
  • Update the 7.0.0 changelog entry for NXDRIVE-3117 (plus assorted formatting/cleanup changes in tools/tests).

Reviewed changes

Copilot reviewed 12 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/scripts/slow_thread_detection.py Docstring formatting cleanup.
tools/changelog.py Reformat multi-line print() example string construction.
tests/unit/test_utils.py Add unit tests validating Windows-only decoding for Web UI direct-transfer URLs.
tests/unit/test_pytest_random.py Reformat makepyfile() multi-line strings for readability.
tests/unit/test_commandline.py Reformat INI file multi-line string writes.
tests/unit/gui/test_folders_treeview.py Remove stray blank line.
tests/unit/gui/init.py Docstring formatting cleanup.
tests/old_functional/test_local_changes_when_offline.py Fix malformed module docstring quoting.
tests/old_functional/common.py Docstring formatting cleanup.
tests/integration/windows/utils.py Replace line-continuation f-string with concatenated f-strings (readability).
tests/functional/test_remote_watcher.py Replace eval()-built structures with explicit dict literals (safer/clearer).
tests/functional/test_remote_client.py Reformat long token strings (no semantic change).
nxdrive/utils.py Implement Windows-only unquote() of Web UI direct-transfer remote_path.
nxdrive/updater/init.py Docstring formatting cleanup.
nxdrive/osi/darwin/pyNotificationCenter.py Docstring formatting cleanup.
nxdrive/logging_config.py Docstring formatting cleanup.
nxdrive/gui/folders_loader.py Unicode escape hex-case change (no semantic impact).
nxdrive/gui/application.py Docstring formatting cleanup.
nxdrive/console.py Docstring formatting cleanup.
nxdrive/commandline.py Docstring formatting cleanup.
nxdrive/client/local/windows.py Docstring formatting cleanup.
nxdrive/client/local/linux.py Docstring formatting cleanup.
nxdrive/client/local/darwin.py Docstring formatting cleanup.
nxdrive/client/local/base.py Docstring formatting cleanup.
nxdrive/client/local/init.py Docstring formatting cleanup.
docs/changes/7.0.0.md Add changelog entry for NXDRIVE-3117 Direct Transfer Web UI fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants