woleet / woleet-weblibs

Woleet WebLibs: Proof verification libraries for browsers and NodeJS.
MIT License
3 stars 3 forks source link

Hasher freezes for too long file paths #19

Closed geoffroy-destaintot closed 3 years ago

geoffroy-destaintot commented 3 years ago

Description

When files have too long file paths, Woleet hasher never starts (no event is triggered - start, error, etc...).

To reproduce the problem, please see attached :

Additional info :

  1. the displayed paths are relative, in our example, the full path was C://{relative_path}
  2. to create very long paths (path lengths are limited, at least on Windows), create a directory structure with very long names (try to almost reach the limit), and then cut/paste the file inside the directory -> this method enables you to go over the limit

Attachments

Short path works

ok

Long paths don't work

ko

angularjs app

debug-too_long_file_paths.zip

geoffroy-destaintot commented 3 years ago

This problem has nothing to do with woleet-weblibs but is more of a Javascript/Windows issue. Apply following code on files with too long paths, and the selected file size will be 0, which is a bug.

<html>
<head>
  <script>
    function selected(files) {
      console.log('###', files)
    }
  </script>
</head>

<body>
<input type="file" webkitdirectory directory onchange="selected(files)">
</body>

</html>