dropbox-sdk-python icon indicating copy to clipboard operation
dropbox-sdk-python copied to clipboard

files_search_v2 returns the same content_hash for all files despite being different file sizes

Open jporcenaluk opened this issue 2 years ago • 1 comments

Describe the bug files_search_v2 returns the same content_hash in the FileMetadata for each file even though they have different file sizes.

To Reproduce

  1. Upload two files of differing sizes to Dropbox
  2. Run the below code or use the files_search_v2 function to return a list of files
  3. Observe that the content_hash value is the same for all files
import dropbox
from dropbox.files import SearchOptions
fun_path = "path_to_folder_in_dropbox"
fun_token = "dropbox_token"
dbx = dropbox.Dropbox(fun_token)
all_files = dbx.files_search_v2(
        query=".", options=SearchOptions(path=fun_path)
    ).matches
metadata = [{"hash": entry.metadata.get_metadata().content_hash, "size": entry.metadata.get_metadata().size } for entry in files_a]
metadata

Expected Behavior

  • I expect to see different content_hash values for different files

Actual Behavior

  • I see the same content_hash values for different files

Screenshots image

Versions

  • dropbox version 11.36.0
  • python 3.11.0
  • OSX

jporcenaluk avatar Jan 27 '23 14:01 jporcenaluk

Thanks for the report! We're investigating this API issue. I'll follow up here once I have an update.

greg-db avatar Jan 27 '23 14:01 greg-db

This should be fixed now. Thanks again for the report!

greg-db avatar Aug 21 '24 19:08 greg-db