adishegde / media_hub

Decentralized file sharing over LAN
https://adishegde.github.io/media_hub/
MIT License
25 stars 2 forks source link

Error in downloaded file's size #8

Closed adishegde closed 6 years ago

adishegde commented 6 years ago

A file which has been downloaded has incorrect file size associated. Restarting the app fixes the error.

adishegde commented 6 years ago

The issue has been narrowed down to file indexing. Currently, the file indexer checks for changes in ctime for directories and then indexes the files in the directory only in case of a change.

But the change in ctime occurs when a write is initiated. This means that when the indexer actually indexes it stores the details of a file being written to, thereby leading to the incorrect size.

adishegde commented 6 years ago

I think it might be more efficient and effective to use chokidar for indexing. The package seems popular and stable.