-
Notifications
You must be signed in to change notification settings - Fork 1
Description
If I retreive messages with a query, i.e.:
api/gc/v1/me/mailFolders/AAAAAG55cVcpA0rYlYKRcCRup8YBAAAAAwAAAMwL-82Ny0ZQud98sYamzIAAAAAA/messages?$top=1000&$search=subject%3DYour
The list of messages is generated. However, the nextlink looks like that:
api/gc/v1/me/mailFolders/AAAAAG55cVcpA0rYlYKRcCRup8YBAAAAAwAAAMwL-82Ny0ZQud98sYamzIAAAAAA/messages?$top=1000&$search=subject%3DYour&$skip=1000
Here, the 'skip' part is ignored. Hence, with this link, again all messages are retrieved. Normally, one has to write a function checking for the nextlink. If the the nextlink returns values, check again for the next nextlink and so on, until the returned value is empty. As in this case, the value never will be empty, the function will never end.
This works with plain api/gc/v1/me/mailFolders/AAAAAG55cVcpA0rYlYKRcCRup8YBAAAAAwAAAMwL-82Ny0ZQud98sYamzIAAAAAA/messages?$top=1000
The culprit seems to lie in backend/kopano/resource.py, in particular in folder_gen, where for queries a yielder() function is provided to replace the actual folder.items generator. count is set 0. But event with a correct count of the generator (i.e. via count = len([item for item in folder.items(quer=query)) the problem remains. I have tried to implement a lambda expression here but was not successful.
This is a pity, as it prevents filtering messages in mailfolders.