o365-moodle
o365-moodle copied to clipboard
Local O365: Groups and Teams endpoints needs pagination
Some Azure user's fields (e.g.: Groups and Teams) has an one to N relationship, so them need to be called with pagination.
Graph Docs:
Non paginated API calls:
- https://github.com/microsoft/o365-moodle/blob/f796d9dfc27fdede24225cbc1ce445fb417fc1cb/local/o365/classes/rest/unified.php#L959
- https://github.com/microsoft/o365-moodle/blob/f796d9dfc27fdede24225cbc1ce445fb417fc1cb/local/o365/classes/rest/unified.php#L976
- https://github.com/microsoft/o365-moodle/blob/f796d9dfc27fdede24225cbc1ce445fb417fc1cb/local/o365/classes/rest/unified.php#L988
Implemented API calls with pagination:
- https://github.com/microsoft/o365-moodle/blob/f796d9dfc27fdede24225cbc1ce445fb417fc1cb/local/o365/classes/feature/usersync/main.php#L332
The proposal is add support to query user info with there pagination.
Great fix! In real world organizations user have a lot of groups. This gonna help me a lot
Hi @joaop221
Thank you so much for making the PR. I have been planning to move all Graph API calls with pagination to a unified function that handles the skip tokens for very long time, but didn't find a good chance, until I see your PRs. I made a few more changes on top of your PR and moved all calls that have pagination that I know of to use the paginatedapicall()
function that you created. There has been some changes to the function itself too to allow it to support a few more different use cases. I have tested all affected function briefly and they all work fine. I'll request a formal system test in this change before it's included in the next release.
Thank you again for your valuable contribution.
Regards, Lai
Hi @joaop221
We are aiming for the week of 11th of March if testing goes smoothly; otherwise it will be the week of 8th of April. I'm away for the three weeks in between.
Sorry for the delay.
Regards, Lai
Hi @joaop221
Changes in this issue are included in the releases from today.
Thank you very much for reporting the issue and providing the solution.
Regards, Lai