google drive sdk - files().list returns incomplete and inconsistent list when using different pageSize -


i have python script attempts list files , folders in given folder.
python code:

page_token = in_json.get('pagetoken', none) res = self._drive.files().list(         orderby='folder, name',         pagesize=1000,         pagetoken='page_token',         q='(\'parent_id\' in parents) , (trashed = false)',         fields='nextpagetoken, files(id, parents, name, modifiedtime, size, mimetype, md5checksum, trashed)').execute() 

parent_id id of parent folder, , page_token set nextpagetoken of previous response.
folder (folder_0) want list contains 4096 files (0.a, 0.b, 1.a, 1.b, ..., 2047.a, 2047.b), return list contains 4095 files (603.a missing)
change query filter q '(\'parent_id\' in parents) and (name = \'603.a\') , (trashed = false)', , keep other fields unchange, file 603.a can list normally.
use original query filter q , change pagesize 400/300/100, different files missing (400: missing 1353.a, 300: no missing, 100: missing 1393.b).
(using same pagesize can same result, i.e., missing ths same file)

i try list other folder (folder_1, folder_2, folder_3), each folder contains 4096 files (0.a, 0.b, 1.a, 1.b, ..., 2047.a, 2047.b).
result: (pagesize: missing files ('x' means no missing files))
folder_1: 100:503.a, 300:1091.a, 400: 1833.b, 1000:x
folder_2: 100:863.b, 300:194.b, 400: x, 1000:x
folder_3: 100:1085.a, 300:1896.a & 64.b, 400: x, 1000:x

i try upload (using files().create) , remove (using files().delete) file within folder (folder_0) observe list result.
when upload file similar name (603_), missing file (603.a) shows up.
remove file uploaded (603_) , list again, 1-st time missing file (603.a) still exist, 2-nd time file disappeared again. below detailed steps:
(when pagesize=1000)
1. files().list: (4095/4096) missing 603.a
2. (upload 603_) → files().list: (4097/4097) x
3. (remove 603_) → files().list: (4096/4096) x
4. (do nothing) → files().list: (4095/4096) missing 603.a
5. (upload 1393_) → files().list: (4096/4097) missing 563.a <--- file missing

(when pagesize=100)
1. files().list: (4095/4096) missing 1393.b
2. (upload 603_) → files().list: (4095/4097) missing 2 files (1393.b , 592.a) <---another file missing
3. (upload 1393_) → files().list: (4097/4098) missing 1491.b <---another file missing
4. (remove 603_) → files().list: (4097/4097) x
5. (remove 1393_) → files().list: (4096/4096) x
6. (do nothing) → files().list: (4095/4096) missing 1393.b

other information:
* not pagetoken issue make sure send request again given nextpagetoken when exists, , concatenate response object list properly.
* condition happens in unlimited storage account. use unlimited storage account , list folders same structure, result list correct.

i have no ideas conditions since there no clear pattern find.
thank taking issue!


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -