Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8210fde69a | |||
| fa6f90621e | |||
| b3f4190614 | |||
| 2fc0024cd2 | |||
| 300a5627fd | |||
| 22f029fe33 | |||
| c728266c88 | |||
| 7f2d57cdad |
@@ -12,6 +12,13 @@ public class RevitObject : DataObject, IRevitObject
|
||||
public required string family { get; set; }
|
||||
public required string category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The level constraint of the object.
|
||||
/// For objects constrained by multiple levels, this represents the base constraint.
|
||||
/// For objects with no level constraint, this should be null.
|
||||
/// </summary>
|
||||
public required string? level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A Curve or Point object representing the location of a Revit element.
|
||||
/// </summary>
|
||||
|
||||
@@ -399,8 +399,9 @@ public sealed class AccountManager(
|
||||
/// <summary>
|
||||
/// Refetches user and server info for each account
|
||||
/// </summary>
|
||||
/// <param name="app"> It is defaultAppId in the server. By default it is "sca" to not break existing parts that this function involves.</param>
|
||||
/// <returns></returns>
|
||||
public async Task UpdateAccounts(CancellationToken ct = default)
|
||||
public async Task UpdateAccounts(CancellationToken ct = default, string app = "sca")
|
||||
{
|
||||
// need to ToList() the GetAccounts call or the UpdateObject call at the end of this method
|
||||
// will not work because sqlite does not support concurrent db calls
|
||||
@@ -415,7 +416,7 @@ public sealed class AccountManager(
|
||||
//TODO: once we get a token expired exception from the server use that instead
|
||||
if (userServerInfo?.activeUser == null || userServerInfo.serverInfo == null)
|
||||
{
|
||||
var tokenResponse = await GetRefreshedToken(account.refreshToken, url).ConfigureAwait(false);
|
||||
var tokenResponse = await GetRefreshedToken(account.refreshToken, url, app).ConfigureAwait(false);
|
||||
userServerInfo = await GetUserServerInfo(tokenResponse.token, url, ct).ConfigureAwait(false);
|
||||
|
||||
if (userServerInfo?.activeUser == null || userServerInfo.serverInfo == null)
|
||||
@@ -766,7 +767,7 @@ public sealed class AccountManager(
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<TokenExchangeResponse> GetRefreshedToken(string refreshToken, Uri server)
|
||||
private async Task<TokenExchangeResponse> GetRefreshedToken(string refreshToken, Uri server, string app = "sca")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -774,8 +775,8 @@ public sealed class AccountManager(
|
||||
|
||||
var body = new
|
||||
{
|
||||
appId = "sca",
|
||||
appSecret = "sca",
|
||||
appId = app,
|
||||
appSecret = app,
|
||||
refreshToken,
|
||||
};
|
||||
|
||||
|
||||
@@ -89,11 +89,12 @@ public sealed class SerializeProcess(
|
||||
|
||||
public void ThrowIfFailed()
|
||||
{
|
||||
//always check for cancellation first
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
if (Exception is not null)
|
||||
{
|
||||
throw new SpeckleException("Error while sending", Exception);
|
||||
}
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
}
|
||||
|
||||
private async Task WaitForSchedulerCompletion()
|
||||
|
||||
Reference in New Issue
Block a user