mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #316] If a directory with a large amount of files is uploaded, only 100 files are actually uploaded #168
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @plantatorbob on GitHub (Dec 11, 2023).
Original GitHub issue: https://github.com/sigoden/dufs/issues/316
Problem
When uploading a directory (using drag-and-drop) that contains more than 100 files, only 100 files are actually uploaded.
This only happens if a directory, which contains files, is uploaded. If a batch of more than 100 files is uploaded as-is, without a directory, everything works as intended.
This partial-upload behaviour only affects Chromium-based browsers (tested in Chrome and Edge).
The problem can be traced to an incorrect use of
readEntriesmethod in File API:https://github.com/sigoden/dufs/blob/main/assets/index.js#L736
As per MDN,
MDN is not very clear in their phrasing: this happens not only on Chrome 77, but on all latest Chromium-based browsers.
This means that
addFileEntriesfunction should take into account thatreadEntriesmay not return full directory listing in one call; multiple calls toreadEntriesmay be required.Chromium bug tracker has an issue describing this behaviour of
readEntries: https://bugs.chromium.org/p/chromium/issues/detail?id=378883Environment: