Join GitHub today
[1.3.10rc2] Multiple tracked files can have the same hash #2908
I've checked the implementation of the tracking plugin and have found, that the sha1 hash of a printed file is computed only from the file name (and the instance id):
sha = hashlib.sha1() sha.update(payload.get("name")) sha.update(self._settings.get([b"unique_id"]))
Wouldn't be better to include also the file path and location into that hash?
sha = hashlib.sha1() sha.update(payload.get("origin")) sha.update(payload.get("path")) sha.update(payload.get("name")) sha.update(self._settings.get([b"unique_id"]))
Because now I can imagine a situation when two completely different files with the same name that are stored in different locations, e.g.:
result in the same hash.
It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Read the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!).
If you did not intend to report a bug but wanted to request a feature or brain storm about some kind of development, please take special note of the title format to use as described in the Contribution Guidelines.
Please do not abuse the bug tracker as a support forum - that can be found at discourse.octoprint.org. Go there for any kind of issues with network connectivity, webcam functionality, printer detection or any other kind of such support requests or general questions.
Also make sure you are at the right place - this is the bug tracker of the official version of OctoPrint, not the Raspberry Pi image OctoPi nor any unbundled third party OctoPrint plugins or unofficial versions. Make sure too that you have read through the Frequently Asked Questions and searched the existing tickets for your problem - try multiple search terms please.
I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2018-12-08 20:30 UTC) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you!
PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them.
That's actually a really good point. Thanks for that.
The filename hashing is only used to be able to potentially track something like "file X was started and cancelled 4h later" for the same instance, but even for that it should definitely be able to differentiate between files in sub folders.