fixed pending share race error on warm app start

This commit is contained in:
2026-07-02 15:28:05 +02:00
parent 4bc7ffd37a
commit 32f7c311bc
9 changed files with 125 additions and 9 deletions
+13 -1
View File
@@ -187,11 +187,23 @@ class _FilesUploadDialogState extends State<FilesUploadDialog> {
'${_uploadableFiles.indexOf(file) + 1}/${_uploadableFiles.length}';
});
// A vanished source file would otherwise surface as a cryptic
// "Content-Length must contain only digits" HttpException, because
// statSync reports size -1 for missing files.
final fileStat = FileStat.statSync(filePath);
if (fileStat.type == FileSystemEntityType.notFound || fileStat.size < 0) {
_showUploadError(
'Die Datei "$fileName" ist nicht mehr verfügbar. '
'Bitte wähle sie erneut aus.',
);
return;
}
final HttpClientResponse uploadTask;
try {
uploadTask = await webdavClient.putFile(
File(filePath),
FileStat.statSync(filePath),
fileStat,
PathUri.parse(fullRemotePath),
onProgress: (progress) {
setState(() {