HelloZeroNet / HelloZeroNet/ZeroNet
`optionalFileInfo` returns incorrect `is_downloaded` value
- Langage dominant
- JavaScript
- Étoiles
- 18.8k
- Forks
- 2.3k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
* ZeroNet version: 0.7.2 (rev4555)
### Step 2: Describe the problem:
https://zeronet.io/docs/site_development/zeroframe_api_reference/#optionalfileinfo
According to the documentation this field has the following semantics:
```
is_downloaded | Whether this file has been completely downloaded
```
However its value is being returned as "1" for files that have never been downloaded.
#### Steps to reproduce:
The issue appears to be a collision in the `hashfield`.
https://github.com/HelloZeroNet/ZeroNet/blob/9d1bed11af8cf92951dd0f335e95101d8b1fa6a4/plugins/OptionalManager/ContentDbPlugin.py#L162-L164
So to reproduce you just need to receive new optional file with a `hash_id` that will collide with another hash in the site's hashfield.
#### Expected Results:
`is_downloaded` should return "1" only if the file has _actually_ been downloaded and "0" otherwise.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Start with plugins/OptionalManager/ContentDbPlugin.py at the linked lines 162-164 and review how the site's hashfield determines optional-file state. Reproduce the hash_id collision described in the issue, then verify that optionalFileInfo reports is_downloaded as "1" only for a file that was actually downloaded and "0" otherwise.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- backend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100