Skip to content

Handle SMB URIs in Linux desktop_drop path parsing#474

Merged
boyan01 merged 3 commits intomainfrom
copilot/fix-linux-smb-drop-issue
Apr 19, 2026
Merged

Handle SMB URIs in Linux desktop_drop path parsing#474
boyan01 merged 3 commits intomainfrom
copilot/fix-linux-smb-drop-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

Linux drops can include smb://... entries, but the current parser unconditionally calls Uri.toFilePath(), which throws for SMB URIs and causes dropped items to be discarded. This change updates Linux drop parsing to preserve SMB URIs while keeping existing file-URI behavior unchanged.

  • Linux drop URI handling

    • In performOperation_linux (packages/desktop_drop/lib/src/channel.dart), parse each dropped line once and branch by scheme:
      • smb → keep original URI string
      • others (e.g. file) → continue converting via toFilePath()
    • This prevents exceptions for network share drops while preserving existing local-path conversion.
  • Focused regression coverage

    • Added packages/desktop_drop/test/channel_linux_test.dart to cover:
      • SMB URI passthrough (smb://server/share/file.txt)
      • File URI conversion (file:///tmp/file.txt/tmp/file.txt)
final uri = Uri.tryParse(e);
if (uri == null) return '';
if (uri.scheme == 'smb') return e;
return uri.toFilePath();

Copilot AI linked an issue Apr 19, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix Linux files from smb-pathes unable to be dropped Handle SMB URIs in Linux desktop_drop path parsing Apr 19, 2026
Copilot AI requested a review from boyan01 April 19, 2026 01:30
@boyan01 boyan01 marked this pull request as ready for review April 19, 2026 09:09
@boyan01 boyan01 merged commit a6d8e7b into main Apr 19, 2026
2 of 3 checks passed
@boyan01 boyan01 deleted the copilot/fix-linux-smb-drop-issue branch April 19, 2026 09: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.

On Linux files from smb-pathes cannot be dropped

2 participants