Filenames are not being truncated with ellipsis to fit max file length correctly
Categories
(Fenix :: Downloads, defect)
Tracking
(Not tracked)
People
(Reporter: npoon, Assigned: npoon)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][group4])
Attachments
(1 file)
1.53 KB,
text/html
|
Details |
Steps to reproduce
- Click on the Long Title website uploaded as an attachment.
- Click on the share icon on the toolbar (next to the 3 dots menu icon)
- Click on "Save as PDF"
- Observe that the Save-as dialog shows that the generated filename will be the following:
- ThisIsAnExtremelyLongTitle1ThisIsAnExtremelyLongTitle2ThisIsAnExtremelyLongTitle3ThisIsAnExtremelyLongTitle4ThisIsAnExtremelyLongTitle5ThisIsAnExtremelyLongTitle6ThisIsAnExtremelyLongTitle7ThisIsAnExtremelyLongTitle8ThisIsAnExtremelyLongTitle9ThisIsAn.pdf
- The actual generated filename is the following different filename:
- ThisIsAnExtremelyLongTitle1ThisIsAnExtremelyLongTitle2ThisIsAnExtremelyLongTitle3ThisIsAnExtremelyLongTitl...Title5ThisIsAnExtremelyLongTitle6ThisIsAnExtremelyLongTitle7ThisIsAnExtremelyLongTitle8ThisIsAnExtremelyLongTitle9ThisIsAn.pdf
Expected behavior
The filename that we show in save-as is exactly 255 characters long -- seems like we're truncating to satisfy that as an upper-limit.
And then the actual final filename is 235 characters long. Maybe that's because Android is truncating so that the full path (including the directory) is 255 characters? (with some 20-character directory name like /sdcard0/downloads/ as a prefix, or whatever).
It might be worth adjusting our own truncation logic to be a bit more conservative so that we don't trigger this odd double-truncation where we reliably lose just a few characters in the middle with a "...".
Assignee | ||
Updated•8 months ago
|
Updated•8 months ago
|
Assignee | ||
Comment 1•8 months ago
|
||
Comment 2•8 months ago
|
||
Relevant additional information from bug 1862795 comment 5, RE the filename ending up 235 characters long here:
Interesting, my "Files" app lets me rename the file to be the full 255 characters long (e.g. I can add the 20 characters
aaaaabbbbbcccccddddd
at the end; and then if I try to add one more character after that, it won't let me).So whoever is doing that middle-ellipsizing-to-shrink-to-235-characters (maybe that's us?) is doing so unnecessarily.
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Updated•7 months ago
|
Comment 3•5 months ago
|
||
Looks like this feature will only be available in Compose UI in 1.8.0 --> https://issuetracker.google.com/issues/185418980#comment15
Comment 4•2 months ago
•
|
||
I retested the attached long filename and Bug 1880023 fixed this. In both the download request dialog and completed dialog, the filename matches and is shortened to fit: ThisIsAnExtremelyLongTitle1ThisIsAnExtremelyLongTitle2ThisIsAnExtremelyLongTitle3ThisIsAnExtremelyLongTitle4ThisIsAnExtremelyLongTitle5ThisIsAnExtremelyLongTitle6ThisIsAnExtremelyLongTitle7ThisIsAnExtremelyLongTitle8.pdf
.
Description
•