Bug 474950

Summary: Downloading file with prefixed tab in name via File Picker causes multiple file section error.
Product: [Applications] dolphin Reporter: Roke Julian Lockhart Beedell <4wy78uwh>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: minor CC: fanzhuyifan, kfm-devel
Priority: NOR    
Version: 23.08.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: File Picker
Error message
Workaround automatically applied using Save As on a file with such a name.

Description Roke Julian Lockhart Beedell 2023-09-27 20:26:53 UTC
SUMMARY

Downloading a file with the name

```txt
	`{id: ""}`{.json5}.txt.pdf
```

to the path `/run/media/RokeJulianLockhart/s11vzd/	`{title: "Entities",	id: "s1ev31"}`{.json5}.dir/	`{name: {short: "Beedell.RokeJulianLockhart",	long: {third: "Beedell",	first: "Roke"}},	id: "s1ev2l"}`{.json5}.dir/	`{title: "Legal",	id: ""}`{.json5}.dir/	`{title: "Your_OIN_License_Agreement",	id: ""}`{.json5}.dir/` fails with the error

> Select only one file

STEPS TO REPRODUCE

0.  Initiate a file download which opens a file picker. Try saving a page using Firefox.
0.  Name it
    ```
    	`{id: ""}`{.json5}.txt.pdf
    ```
0.  Press "Save".

OBSERVED RESULT

It fails with the error

> Select only one file

EXPECTED RESULT

It should be saved without issue with the name chosen.

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20230922
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.4-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor
Memory: 30.5 GiB of RAM
Graphics Processor: AMD Radeon RX 5700
Manufacturer: ASRock
Product Name: X670E Taichi

ADDITIONAL INFORMATION

It can be worked around by simply renaming the file after it has been saved, but this is certainly not ideal.
Comment 1 Roke Julian Lockhart Beedell 2023-09-27 20:27:53 UTC
(In reply to third="Beedell", first="Roke", second="Julian Lockhart" from comment #0)
> SUMMARY
> 
> Downloading a file with the name
> 
> ```txt
> 	`{id: ""}`{.json5}.txt.pdf
> ```
> 
> to the path `/run/media/RokeJulianLockhart/s11vzd/	`{title: "Entities",	id:
> "s1ev31"}`{.json5}.dir/	`{name: {short: "Beedell.RokeJulianLockhart",	long:
> {third: "Beedell",	first: "Roke"}},	id: "s1ev2l"}`{.json5}.dir/	`{title:
> "Legal",	id: ""}`{.json5}.dir/	`{title: "Your_OIN_License_Agreement",	id:
> ""}`{.json5}.dir/` fails with the error
> 
> > Select only one file
> 
> STEPS TO REPRODUCE
> 
> 0.  Initiate a file download which opens a file picker. Try saving a page
> using Firefox.
> 0.  Name it
>     ```
>     	`{id: ""}`{.json5}.txt.pdf
>     ```
> 0.  Press "Save".
> 
> OBSERVED RESULT
> 
> It fails with the error
> 
> > Select only one file
> 
> EXPECTED RESULT
> 
> It should be saved without issue with the name chosen.
> 
> SOFTWARE/OS VERSIONS
> 
> Operating System: openSUSE Tumbleweed 20230922
> KDE Plasma Version: 5.27.8
> KDE Frameworks Version: 5.110.0
> Qt Version: 5.15.10
> Kernel Version: 6.5.4-1-default (64-bit)
> Graphics Platform: X11
> Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor
> Memory: 30.5 GiB of RAM
> Graphics Processor: AMD Radeon RX 5700
> Manufacturer: ASRock
> Product Name: X670E Taichi
> 
> ADDITIONAL INFORMATION
> 
> It can be worked around by simply renaming the file after it has been saved,
> but this is certainly not ideal.

I keep forgetting that this Bugzilla instance is too old to use Markdown. It'll be more readable if you quickly copy it into Kate.
Comment 2 Roke Julian Lockhart Beedell 2023-09-27 20:29:15 UTC
Created attachment 161918 [details]
File Picker
Comment 3 Roke Julian Lockhart Beedell 2023-09-27 20:29:29 UTC
Created attachment 161919 [details]
Error message
Comment 4 fanzhuyifan 2023-10-25 15:50:20 UTC
Humm I am failing to reproduce the bug. On my end saving to
```txt
	`{id: ""}`{.json5}.txt.pdf
```
always works, with both firefox and firefox-nightly, using the dolphin file picker (with `GTK_USE_PORTAL=1`).

On your end, could you verify if the name of the parent directories matter? Or does saving to this particular filename always fail regardless of whether the parent directories have well behaved names?
Comment 5 Roke Julian Lockhart Beedell 2023-10-26 02:11:33 UTC
(In reply to fanzhuyifan from comment #4)
> Humm I am failing to reproduce the bug. On my end saving to
> ```txt
> 	`{id: ""}`{.json5}.txt.pdf
> ```
> always works, with both firefox and firefox-nightly, using the dolphin file
> picker (with `GTK_USE_PORTAL=1`).
> 
> On your end, could you verify if the name of the parent directories matter?
> Or does saving to this particular filename always fail regardless of whether
> the parent directories have well behaved names?

The parent directory name is irrelevant.
Comment 6 Roke Julian Lockhart Beedell 2023-10-26 02:13:49 UTC
Created attachment 162571 [details]
Workaround automatically applied using Save As on a file with such a name.

Although this doesn't fix the issue, this depicts a temporary workaround used automatically by the File Picker when using Save As on an existent open file with relevant UTF-8 characters in its name (since obviously someone encountered this exact bug at some point in the past but didn't fix it entirely).

This isn't a fix because it requires prior knowledge of how to escape such characters, which isn't a skill we should expect of most users, and doesn't appear to be documented.