o365-moodle icon indicating copy to clipboard operation
o365-moodle copied to clipboard

Local O365: Groups and Teams endpoints needs pagination

Open joaop221 opened this issue 1 year ago • 2 comments

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.

joaop221 avatar Dec 05 '23 18:12 joaop221

Great fix! In real world organizations user have a lot of groups. This gonna help me a lot

douglasfernandesjr avatar Dec 06 '23 14:12 douglasfernandesjr

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

weilai-irl avatar Jan 17 '24 22:01 weilai-irl

Hi @weilai-irl.

Is there a new due date for 2024-01 milestone's features?

joaop221 avatar Feb 29 '24 13:02 joaop221

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

weilai-irl avatar Feb 29 '24 14:02 weilai-irl

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

weilai-irl avatar Mar 11 '24 14:03 weilai-irl