-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure Folder Async hits the Sharepoint Limit of 5000 #793
Comments
@jansenbe I've replicated this issue and the error happens in the function "EnsureFolderAsync" in Folder.cs on line 324 when the subfolders are being loaded. The error being thrown is that the list view item limit has been exceeded. What we might do is check the value of "ItemCount" of the currentfolder and when this exceeds 5000 we'll have to make an adjustment to load the subfolders on a different way than using the REST API call. |
@MathijsVerbeeck @ChrTall as we had this problem as well with the current inefficient implementation of EnsureFolderAsync, see my workaround here:
Hope it helps! |
@Ironbell : excellent approach! I'll update our implementation with your code. Thanks for sharing the fix :-) |
…t the need to load all folders on a level, this way the method works on libraries with a large amount of folders #793
Category
Describe the bug
If you use EnsureFolderAsync for a Folder in a large document Library that has more than 5000 SubFolders a SPQueryThrottledException is thrown, because we hit the 5000 ListItem Limit of Sharepoint Online, which can not be increased, can it?
Steps to reproduce
var site = await targetSiteContext.Web.Lists.GetByTitleAsync("VeryBigLib"); var rootFolder = await site.RootFolder.GetAsync(); await rootFolder.EnsureFolderAsync("/FolderWithManySubFolders/TEST/TEST/TEST");
Expected behavior
It would be great if this could be implemented in a way that you can rely on it even when your library grows over time and eventually will hit the limit.
Environment details (development & target environment)
The text was updated successfully, but these errors were encountered: