hyperdrive icon indicating copy to clipboard operation
hyperdrive copied to clipboard

duplicate entry shouldn't get added to metadata twice

Open joehand opened this issue 7 years ago • 4 comments

If the same file, with the same content + metadata, is added twice, it shouldn't be added to the metadata twice.

Happening in the CLI. We can fix it there, but it seems like we should also protect against this in hyperdrive.

joehand avatar Oct 10 '16 22:10 joehand

Unsure about this. I'm leaning towards "just dont do that" as checking if a file already exists has none trivial perf overhead (needs hashing)

mafintosh avatar Oct 10 '16 23:10 mafintosh

Yeah I suggest we check the hash against current and noop if it's not a change. Then we add an option flag, allowDuplicate or something like that, which if true will skip the hash check.

pfrazee avatar Oct 10 '16 23:10 pfrazee

Hashing will impose a significant overhead. While more correct, we might still get better results with just "overwriting" with the identical, no?

juliangruber avatar Oct 11 '16 15:10 juliangruber

The hashing will occur in either situation, won't it? You have to hash any new writes to the hypercore

pfrazee avatar Oct 11 '16 16:10 pfrazee