Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Model file corrupted #172

Open
halawnss opened this issue Jan 16, 2025 · 5 comments · May be fixed by #173
Open

[Bug]: Model file corrupted #172

halawnss opened this issue Jan 16, 2025 · 5 comments · May be fixed by #173
Labels
bug Something isn't working

Comments

@halawnss
Copy link

Describe the bug
A clear and concise description of what the bug is.

When downloading from HF , suddenly it stops , says file is corrupted and asks me to delete it and download it again

Screenshots
If applicable, add screenshots to help explain your problem.

Image

Image

Environment (please complete the following information):

  • Device: [e.g., iPhone 12]
  • OS: [e.g., iOS 14.4, Android 11]
  • App Version: [e.g., 1.0.0]

Redmi 7 , MIUI 11 , Android 10 , version 1.6.5 (44)

@halawnss halawnss added the bug Something isn't working label Jan 16, 2025
@a-ghorbani
Copy link
Owner

a-ghorbani commented Jan 16, 2025

Thanks. I am able to reproduce. Strangely, RNFS.hash(file, 'sha256') is not giving the same hash code as let say, shasum -a 256 would give for some files.

@halawnss
Copy link
Author

Welcome

@a-ghorbani
Copy link
Owner

I will use file size first, as it is a much less expensive operation compared to hashing for large files. If the file size check fails, I will use hashing as a fallback for double-checking.

I also reported the issue here: birdofpreyru/react-native-fs#99

@a-ghorbani
Copy link
Owner

a-ghorbani commented Jan 17, 2025

@halawnss btw your issue is not be related to the hash calculation problem, as the file sizes differ from the expected model file size. Does this happen (download interruption) when your app is in the background while downloading?

But this mean we need gracefully deal with the interrupted downloads, like clean up etc, to avoid the confusion.

@halawnss
Copy link
Author

halawnss commented Jan 17, 2025

@a-ghorbani download interruption happened 4 times on 1.6.2 :

  • once: immediately when the screen was accidentally turned off (I forgot to set the screen off period to " never ")
  • twice: without getting out of the app at all
  • once: after a while of running app in background for a short period and then coming back - multiple times - ( in v1.5.9 - which I used to use before updating - , I used to do this a lot and never faced such a problem )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants