Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Bad file drop paths when path has spaces on Ubuntu #4034

Closed
betamos opened this issue May 2, 2022 · 3 comments
Closed

[bug] Bad file drop paths when path has spaces on Ubuntu #4034

betamos opened this issue May 2, 2022 · 3 comments
Assignees
Labels
scope: core Core packages of Tauri type: bug

Comments

@betamos
Copy link
Contributor

betamos commented May 2, 2022

Describe the bug

The tauri://file-drop and tauri://file-drop-hover events contain paths which appear urlencoded. For example:

"/path/to/my file.ext" => "path/to/my%20file.ext"

I'm printing both from js and from the rust/tauri event loop, and the issues appears in both places. It does not appear on other platforms.

Reproduction

  1. Drop a file with spaces on Ubuntu (possibly all of linux).
  2. Check it's path.

Expected behavior

File paths have their original name.

To be pedantic, I think there's a long tail of non well-formed file paths, since some platforms allow all kinds of stuff (including 0x00 null bytes). I think as long as most common special chars are working, it's ok.

Platform and versions

Environment
  › OS: Ubuntu 20.04 X64
  › Node.js: 16.15.0
  › npm: 8.5.5
  › pnpm: Not installed!
  › yarn: 1.22.10
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.9
  › @tauri-apps/api [NPM]: 1.0.0-rc.4
  › tauri [RUST]: git+https://github.com/betamos/tauri?branch=betamos-head#9ef128453b35812c6a92d880826901e3055e9ac7 (1.0.0-rc.8),
  › tauri-build [RUST]: git+https://github.com/betamos/tauri?branch=betamos-head#9ef128453b35812c6a92d880826901e3055e9ac7 (1.0.0-rc.7),
  › tao [RUST]: 0.8.3,
  › wry [RUST]: 0.15.1,

App
  › build-type: bundle
  › CSP: default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  › distDir: ../ui/public
  › devPath: ../ui/public

App directory structure
  ├─ node_modules
  ├─ bin
  ├─ agent
  ├─ app
  ├─ .vscode
  ├─ src-svelte
  ├─ scripts
  ├─ ui
  └─ .git

Yes, tauri core is my own fork, which has a couple of unrelated changes. It was rolled to dev HEAD yesterday and it was a problem before that as well (I held off with the report until I had checked it's still an issue).



### Stack trace

_No response_

### Additional context

_No response_
@amrbashir amrbashir added the scope: core Core packages of Tauri label May 2, 2022
@betamos
Copy link
Contributor Author

betamos commented May 2, 2022

Btw, just verified that this is NOT happening with the dialog file browse API. Those paths are correct.

@lucasfernog
Copy link
Member

Thanks for catching this!

@betamos
Copy link
Contributor Author

betamos commented May 4, 2022

Thanks yourself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core Core packages of Tauri type: bug
Projects
None yet
Development

No branches or pull requests

3 participants