Added max list size circumvention for file transfers between sites.

This commit is contained in:
Dev
2026-05-13 15:58:16 +02:00
parent 4b51c8e3c3
commit 5d305ccc4c
27 changed files with 996 additions and 145 deletions
@@ -23,7 +23,7 @@ namespace SharepointToolbox.Services;
/// </summary>
public class SharePointGroupResolver : ISharePointGroupResolver
{
private readonly AppGraphClientFactory? _graphClientFactory;
private readonly AppGraphClientFactory _graphClientFactory;
public SharePointGroupResolver(AppGraphClientFactory graphClientFactory)
{
@@ -57,6 +57,7 @@ public class SharePointGroupResolver : ISharePointGroupResolver
foreach (var g in ctx.Web.SiteGroups)
groupTitles.Add(g.Title);
}
catch (OperationCanceledException) { throw; }
catch (Exception ex)
{
Log.Warning("Could not enumerate SiteGroups on {Url}: {Error}", ctx.Url, ex.Message);
@@ -92,7 +93,7 @@ public class SharePointGroupResolver : ISharePointGroupResolver
if (IsAadGroup(user.LoginName))
{
// Lazy-create graph client on first AAD group encountered
graphClient ??= await _graphClientFactory!.CreateClientAsync(clientId, ct);
graphClient ??= await _graphClientFactory.CreateClientAsync(clientId, ct);
var aadId = ExtractAadGroupId(user.LoginName);
var leafUsers = await ResolveAadGroupAsync(graphClient, aadId, ct);
@@ -110,6 +111,7 @@ public class SharePointGroupResolver : ISharePointGroupResolver
.DistinctBy(m => m.Login, StringComparer.OrdinalIgnoreCase)
.ToList();
}
catch (OperationCanceledException) { throw; }
catch (Exception ex)
{
Log.Warning("Could not resolve SP group '{Group}': {Error}", groupName, ex.Message);
@@ -182,6 +184,7 @@ public class SharePointGroupResolver : ISharePointGroupResolver
await pageIterator.IterateAsync(ct);
return members;
}
catch (OperationCanceledException) { throw; }
catch (Exception ex)
{
Log.Warning("Could not resolve AAD group '{Id}' transitively: {Error}", aadGroupId, ex.Message);