dropbox / dropbox-sdk-python

The Official Dropbox API V2 SDK for Python
https://www.dropbox.com/developers
MIT License
930 stars 318 forks source link

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

Closed jporcenaluk closed 2 days ago

jporcenaluk commented 1 year ago

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

Actual Behavior

Screenshots

image

Versions

greg-db commented 1 year ago

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

greg-db commented 2 days ago

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