Repository navigation
perf(files): fix REST maxUrlLength 401 on deep subsites and optimize batch plan generation - #183
Merged
NityamPareek merged 1 commit intoSep 22, 2026
Conversation
…batch plan generation
embiway
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two issues observed on large tenants (~35,800 Document Libraries, deeply nested 9-12 level subsites):
Eliminates
maxUrlLength401 failures on deeply nested subsites (346 failed drives -> 0):GetList('/sites/...')andGetFolderByServerRelativeUrl('/sites/...')), repeating the 9-12 level subsite path twice in the URL path (~395-486 chars) and exceeding ASP.NET's 260-charactermaxUrlLengthlimit onRequest.Path.@v(GetList(@v)?@v='...'andGetFolderByServerRelativeUrl(@v)?@v='...'), moving the ~200-character library path into the query string (maxQueryStringLength>= 2048 bytes).base_urlpath >= 218 chars) whereGetFolderByServerRelativeUrl(@v)would still reach 260 chars, addresses the folder viaGetList(@v)/RootFolder(10 chars shorter in the URL path, identical JSON response).maxUrlLengthorRuntime Errorinstead of triggering 5 redundant certificate token refreshes.Optimizes Migration Plan / Batch Generation (~72 minutes -> ~3.1 seconds on 35,000 sites):
(target_hours, lanes)candidates.1..5) instead of repeating across all 16candidate_hours.Suggested Batchcolumn once on the selected plan inO(N)instead of running anO(N^2)boolean lookup across all 80 candidate iterations.Verification
Ran 64 tests in 2.067s - OK).< 260characters across all 9-12 level subsite URLs from the tenant logs.