Repository navigation
fix: report folders and unreadable files instead of uploading them - #4214
Merged
Merged
Conversation
jcbrand
force-pushed
the
fix-paste-directory
branch
from
November 3, 2026 07:03
e879802 to
9ab6b6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copying a folder in a file manager (e.g. GNOME Files) and pasting it into the chat composer tried to upload it, which fails with "Sorry, looks like file upload is not supported by your server." (or a failed upload on servers that support it). Dropping a folder did the same.
Chromium exposes such a folder as a typeless
Filewhose size is the directory's size on disk (4096 bytes here), so it can't be told apart by size or type. It can't be read, though. The upload paths now check this before uploading anything:sendFilesin headless (chat and MUC, however the file was added: paste, drop or the attachment menu) anduploadFile(the Social composer). A file that is empty, a folder, or no longer readable (e.g. deleted after it was copied) isn't uploaded, and the user is told why:The Social composer also gains a drop handler, so files dropped onto it are uploaded just like pasted ones. Previously only pasting was handled there.
Inserting the folder's path as text instead was considered but left out: Chromium hides that text from scripts, and recovering it needed a hidden "paste bin" textarea in the shared editor, too much complexity for a niche case. Copying the location with Ctrl+L in Files gives plain text, which already pastes fine.
The read check was verified live in Brave against Prosody with a real GNOME Files copy: the folder fails to read, a copied file reads fine.