mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[PR #139] fix(sharepoint): follow @odata.nextLink when listing folders #130
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/oikb#130
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/oikb/pull/139
Author: @roydonsequeira
Created: 10/5/2026
Status: 🔄 Open
Base:
main← Head:fix/sharepoint-children-paging📝 Commits (2)
add2172fix(sharepoint): follow @odata.nextLink when listing folders3e577bfMerge remote-tracking branch 'origin/main' into fix/sharepoint-children-paging📊 Changes
2 files changed (+70 additions, -5 deletions)
View changed files
📝
src/oikb/connectors/sharepoint.py(+10 -4)📝
tests/test_sharepoint.py(+60 -1)📄 Description
Fixes #96.
_walk_foldermakes oneGET .../childrenrequest per folder and reads only itsvalue:Graph returns 200 children per page by default and links the rest through
@odata.nextLink(list children, paging). Nothing reads that link, so:/sync/diff, so files synced before the folder outgrew one page come back as deleted, andsync_cleanupremoves them from the Knowledge Base;_walk_foldernow collects every page of a folder, following@odata.nextLinkuntil Graph stops sending one, then walks the items exactly as before. The link is an absolute URL, and httpx sends absolute URLs as given even withbase_urlset. So it goes back unchanged, as the paging docs ask, whichever cloud it points at. An empty page that still carries a link is followed too; the docs say a page may hold zero results.Verification
I don't have a SharePoint tenant, so this is verified against Graph-shaped responses. #96 has a live reproduction against a real library:
$top=50on a 187-entry folder returns 50 entries and a nextLink.The new test in
tests/test_sharepoint.pybuilds the connector against mocked Graph routes:On main the manifest has 2 of the 5 files (
Reports/q1.xlsx,a.pdf). With this change it has all 5, and the root is requested three times, using each nextLink exactly as given. The test also fails if the loop stops at an empty page or follows only one link. Full suite: 52 passed on main (672094b), 53 on this branch (Python 3.11).#137 landed first and also added
tests/test_sharepoint.py, so this branch now merges main (3e577bf). Its tests are unchanged, except that their token, site and drive routes moved into_mock_site, which the paging test reuses.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.