Dropbox has given ample warnings about adapting to Teams and Shared Spaces. However, applying these updates have been staggered and this Sunday I lost all connections to team folders in a Blazor Server .NET 8 service class. I solved it by inverting this condition:
if (!account.RootInfo.IsTeam)
to
if (account.RootInfo.IsTeam)
I honestly don't know why this works but at least it got the production app back online. Reference to the DropboxClient WithPathRoot(PathRoot) code is here and this is the example code in case it helps anyone:
// Fetch root namespace info from user's account info.
var account = await client.Users.GetCurrentAccountAsync();
if (!account.RootInfo.IsTeam) // CHANGE THIS to (account.RootInfo.IsTeam)
{
Console.WriteLine("This user doesn't belong to a team with shared space.");
}
else
{
try
{
// Point path root to namespace id of team space.
client = client.WithPathRoot(new PathRoot.Root(account.RootInfo.RootNamespaceId));
await client.Files.ListFolderAsync(path);
}
catch (PathRootException ex)
{
// Handle race condition when user switched team.
Console.WriteLine(
"The user's root namespace ID has changed to {0}",
ex.ErrorResponse.AsInvalidRoot.Value);
}
}