Web.EnsureFolderPathImplementation throws "The attempted operation is prohibited because it exceeds the list view threshold."
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
Resolve-PnPFolder directly uses the EnsureFolderPathImplementation extension.
When 5000 sub-folders exist in a folder, calling EnsureFolderPath/EnsureFolderPathAsync/EnsureFolderPathImplementation results in the following error:
The attempted operation is prohibited because it exceeds the list view threshold.
I guess this is due to the loading of all sub-folders in a given folder:
Also, I guess that this is related to https://github.com/pnp/powershell/issues/2286.
Steps to reproduce:
Connect-PnPOnline -Interactive "... your site ..."
1..5005 | ForEach-Object { Resolve-PnPFolder -SiteRelativePath "SitePages/testFolder/f_$_" }
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/lib/PnP.Framework/Extensions/FileFolderExtensions.cs around lines 913-916 and trace EnsureFolderPath, EnsureFolderPathAsync, and EnsureFolderPathImplementation as used by Resolve-PnPFolder. Reproduce with the provided PowerShell loop creating 5,005 subfolders, then verify that the folder-path operations no longer fail with the list view threshold error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100