Compare commits

..

3 Commits

Author SHA1 Message Date
Adam Hathcock 701013ad46 Merge pull request #393 from specklesystems/dev
.NET Build and Publish / build (push) Has been cancelled
dev to main for release (DONUT squash)
2025-09-24 10:22:05 +01:00
Adam Hathcock fdc0842b03 Merge pull request #388 from specklesystems/dev
.NET Build and Publish / build (push) Has been cancelled
Main to dev (no squash)
2025-09-12 12:04:04 +01:00
Jedd Morgan 23d5dd44bc Merge pull request #382 from specklesystems/dev
.NET Build and Publish / build (push) Has been cancelled
Dev -> Main for release
2025-09-08 10:54:56 +01:00
6 changed files with 24 additions and 21 deletions
+1 -1
View File
@@ -35,6 +35,6 @@ public class RenderMaterial : Base
public Color emissiveColor
{
get => Color.FromArgb(emissive);
set => emissive = value.ToArgb();
set => diffuse = value.ToArgb();
}
}
@@ -2,7 +2,6 @@ using Microsoft.Extensions.Logging;
using Speckle.Sdk.Logging;
using Speckle.Sdk.Models;
using Speckle.Sdk.Serialisation;
using Speckle.Sdk.Serialisation.V2.Receive;
using Speckle.Sdk.Transports;
namespace Speckle.Sdk.Api;
@@ -23,8 +22,7 @@ public partial class Operations
string objectId,
string? authorizationToken,
IProgress<ProgressArgs>? onProgressAction,
CancellationToken cancellationToken,
DeserializeProcessOptions? options = null
CancellationToken cancellationToken
)
{
using var receiveActivity = activityFactory.Start("Operations.Receive");
@@ -38,8 +36,7 @@ public partial class Operations
streamId,
authorizationToken,
onProgressAction,
cancellationToken,
options
cancellationToken
);
try
{
@@ -25,8 +25,7 @@ public partial class Operations
string? authorizationToken,
Base value,
IProgress<ProgressArgs>? onProgressAction,
CancellationToken cancellationToken,
SerializeProcessOptions? options = null
CancellationToken cancellationToken
)
{
using var receiveActivity = activityFactory.Start("Operations.Send");
@@ -39,8 +38,7 @@ public partial class Operations
streamId,
authorizationToken,
onProgressAction,
cancellationToken,
options
cancellationToken
);
try
{
+16 -5
View File
@@ -43,7 +43,7 @@ public static class SpecklePathProvider
/// <see cref="Environment.SpecialFolder.ApplicationData"/> path usually maps to
/// <ul>
/// <li>win: <c>%appdata%/</c></li>
/// <li>MacOS: <c>~/Library/Application Support</c></li>
/// <li>MacOS: <c>~/.config/</c></li>
/// <li>Linux: <c>~/.config/</c></li>
/// </ul>
/// </remarks>
@@ -57,18 +57,29 @@ public static class SpecklePathProvider
return pathOverride;
}
// on desktop linux and macos we use the appdata.
// but we might not have write access to the disk
// so the catch falls back to the user profile
try
{
return Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationData,
// It's not a given that the folder is already there on all OS-es, so we'll create it
// if the folder doesn't exist, we get back an empty string on OSX,
// which in turn, breaks other stuff down the line.
// passing in the Create option ensures that this directory exists,
// which is not a given on all OS-es.
Environment.SpecialFolderOption.Create
);
}
catch (PlatformNotSupportedException)
catch (SystemException ex) when (ex is PlatformNotSupportedException or ArgumentException)
{
// We might not have write access to the disk to create the folder,
// so we'll fall back to the user profile
//Adding this log just so we confidently know which Exception type to catch here.
// TODO: Must re-add log call when (and if) this get's made as a service
//SpeckleLog.Logger.Warning(ex, "Falling back to user profile path");
// on server linux, there might not be a user setup, things can run under root
// in that case, the appdata variable is most probably not set up
// we fall back to the value of the home folder
return Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
}
}
@@ -63,7 +63,7 @@ public class ServerObjectManager : IServerObjectManager
childrenHttpMessage.RequestUri = new Uri($"/api/v2/projects/{_streamId}/object-stream/", UriKind.Relative);
childrenHttpMessage.Method = HttpMethod.Post;
Dictionary<string, object> postParameters = new() { { "objectIds", objectIds } };
Dictionary<string, string> postParameters = new() { { "objectIds", JsonConvert.SerializeObject(objectIds) } };
if (!string.IsNullOrWhiteSpace(attributeMask))
{
postParameters.Add("attributeMask", attributeMask.NotNull());
@@ -31,12 +31,9 @@ public class ServerObjectManagerTests : MoqTest
var jObject = new JObject { { "id", id }, { "value", true } };
var jObject2 = new JObject { { "id", id2 }, { "value", true } };
var mockHttp = new MockHttpMessageHandler();
Dictionary<string, object> postParameters = new()
Dictionary<string, string> postParameters = new()
{
{
"objectIds",
new List<string> { id, id2 }
},
{ "objectIds", JsonConvert.SerializeObject(new List<string> { id, id2 }) },
};
string serializedPayload = JsonConvert.SerializeObject(postParameters);