aglinxinyuan opened a new issue, #7457:
URL: https://github.com/apache/texera/issues/7457
### Describe the bug
Dropping a folder onto the dataset file uploader reports a file failure that
did not happen.
In `files-uploader.component.ts`, a dropped entry that is not a file
resolves to `null`:
```ts
} else {
resolve(null); // directory
}
```
Those nulls are then filtered out of `successfulUploads`, but the failure
count is computed against the *unfiltered* results:
```ts
const failedCount = results.length - successfulUploads.length;
if (failedCount > 0) {
this.showFileUploadBanner("error", `${failedCount} file${failedCount > 1 ?
"s" : ""} failed to be selected.`);
}
```
A directory therefore counts as a failed file, even though nothing failed
and nothing was meant to be uploaded.
### To Reproduce
1. Open a dataset and drag a **folder** onto the file drop area (alone, or
alongside a valid file).
2. A red banner appears: *"1 file failed to be selected."*
3. Any valid files dropped alongside it are still selected correctly — only
the banner is wrong.
### Expected behavior
A dropped directory is not a failure. `failedCount` should count only
entries that actually rejected, i.e. exclude the deliberate `resolve(null)`
cases — for example by tracking rejections separately, or by counting
`results.filter(r => r.status === "rejected").length` rather than deriving from
the length difference.
### Additional context
Found while adding coverage for the drop path. The accompanying test asserts
only that the directory is excluded from the selection and deliberately does
**not** assert the banner, so the miscount is not cemented while it stands.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]