Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/trigger-PR-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
mkdir -p src/ByteSync.Client
echo "$CLIENT_LOCAL_SETTINGS_JSON" > src/ByteSync.Client/local.settings.json

- name: Setup .NET 8 Environment
- name: Setup .NET 10 Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '10.0.x'

- name: Install SonarScanner for .NET
run: |
Expand Down Expand Up @@ -98,10 +98,10 @@ jobs:
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET 8 Environment
- name: Setup .NET 10 Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '10.0.x'

- name: Create Config Files
shell: bash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ByteSync.Business.Inventories;
using ByteSync.Business.Inventories;
using ByteSync.Common.Business.Actions;
using ByteSync.Common.Business.EndPoints;
using ByteSync.Common.Business.Inventories;
Expand Down Expand Up @@ -74,7 +74,7 @@
return result;
}

public string GetFullName(SharedDataPart sharedDataPart)

Check warning on line 77 in src/ByteSync.Client/Business/Actions/Shared/SharedActionsGroup.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Member 'GetFullName' does not access instance data and can be marked as static

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1pYaXgLpooCJKpBP6n&open=AZ1pYaXgLpooCJKpBP6n&pullRequest=284
{
string sourceFileName;
if (sharedDataPart.InventoryPartType == FileSystemTypes.Directory)
Expand Down
14 changes: 7 additions & 7 deletions src/ByteSync.Client/ByteSync.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<DisableWinExeOutputInference>true</DisableWinExeOutputInference>
<ApplicationIcon>Assets\ByteSync.ico</ApplicationIcon>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
Expand Down Expand Up @@ -65,13 +65,13 @@
<PackageReference Include="DynamicData" Version="9.4.1"/>
<PackageReference Include="FastRsyncNet" Version="2.4.4"/>
<PackageReference Include="LiveChartsCore.SkiaSharpView.Avalonia" Version="2.0.0-beta.700"/>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.23"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1"/>
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="10.0.5"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.5"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.5"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5"/>
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.5"/>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.22"/>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3"/>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5"/>
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0"/>
<PackageReference Include="Polly" Version="8.6.5"/>
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1">
Expand Down
6 changes: 3 additions & 3 deletions src/ByteSync.Common/ByteSync.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
<PackageId>ByteSync.Common</PackageId>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="System.IO.Abstractions" Version="22.1.0"/>
</ItemGroup>
Expand Down
22 changes: 11 additions & 11 deletions src/ByteSync.Functions/ByteSync.Functions.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -13,19 +13,19 @@
<PackageReference Include="Azure.Identity" Version="1.17.1"/>
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.24.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.51.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="2.50.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.3.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.14.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.23"/>
<PackageReference Include="Microsoft.Azure.SignalR" Version="1.32.0"/>
<PackageReference Include="Microsoft.Azure.SignalR.Management" Version="1.32.0"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.7" />
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.5"/>
<PackageReference Include="Microsoft.Azure.SignalR" Version="1.33.0"/>
Comment on lines 20 to +24
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says Microsoft.Azure.AppConfiguration.AspNetCore was upgraded to 8.5.0, but this project still references 8.1.2. Either bump this PackageReference to the intended version or adjust the PR description/table so it matches the actual upgrade set.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in commit f53a5ee

<PackageReference Include="Microsoft.Azure.SignalR.Management" Version="1.33.0"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
<PackageReference Include="RedLock.net" Version="2.3.2" />
<PackageReference Include="StackExchange.Redis" Version="2.10.1"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
}
}

private async Task<string?> ExtractToken(FunctionContext context)

Check warning on line 114 in src/ByteSync.Functions/Helpers/Middlewares/JwtMiddleware.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Member 'ExtractToken' does not access instance data and can be marked as static

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1Tr8lNDjkrgjePQylM&open=AZ1Tr8lNDjkrgjePQylM&pullRequest=284
{
var requestData = await context.GetHttpRequestDataAsync();
if (requestData == null)
Expand Down Expand Up @@ -182,12 +182,12 @@
if (httpReqData != null)
{
var newHttpResponse = httpReqData.CreateResponse(httpStatusCode);
await newHttpResponse.WriteAsJsonAsync(new { ResponseStatus = message }, newHttpResponse.StatusCode);
await newHttpResponse.WriteAsJsonAsync(new { ResponseStatus = message });
context.GetInvocationResult().Value = newHttpResponse;
}
}

private string GetEntryPoint<T>(string methodName)

Check warning on line 190 in src/ByteSync.Functions/Helpers/Middlewares/JwtMiddleware.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Member 'GetEntryPoint' does not access instance data and can be marked as static

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1Tr8lNDjkrgjePQylN&open=AZ1Tr8lNDjkrgjePQylN&pullRequest=284
{
return typeof(T).Namespace + "." + typeof(T).Name + "." + methodName;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ByteSync.Functions/Http/AnnouncementFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task<HttpResponseData> GetAnnouncements(
var announcements = await _mediator.Send(new GetActiveAnnouncementsRequest());

var response = req.CreateResponse();
await response.WriteAsJsonAsync(announcements, HttpStatusCode.OK);
await response.WriteAsJsonAsync(announcements);
return response;
}
}
12 changes: 7 additions & 5 deletions src/ByteSync.Functions/Http/AuthFunction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Net;
using System.Net;
using ByteSync.Common.Business.Auth;
using ByteSync.Functions.Helpers.Misc;
using ByteSync.ServerCommon.Commands.Authentication;
Expand Down Expand Up @@ -30,11 +30,12 @@ public async Task<HttpResponseData> Login([HttpTrigger(AuthorizationLevel.Anonym
var response = req.CreateResponse();
if (authResult.IsSuccess)
{
await response.WriteAsJsonAsync(authResult, HttpStatusCode.OK);
await response.WriteAsJsonAsync(authResult);
}
else
{
await response.WriteAsJsonAsync(authResult, HttpStatusCode.Unauthorized);
response.StatusCode = HttpStatusCode.Unauthorized;
await response.WriteAsJsonAsync(authResult);
}

return response;
Expand All @@ -52,11 +53,12 @@ public async Task<HttpResponseData> RefreshTokens([HttpTrigger(AuthorizationLeve
var response = req.CreateResponse();
if (authResult.IsSuccess)
{
await response.WriteAsJsonAsync(authResult, HttpStatusCode.OK);
await response.WriteAsJsonAsync(authResult);
}
else
{
await response.WriteAsJsonAsync(authResult, HttpStatusCode.Unauthorized);
response.StatusCode = HttpStatusCode.Unauthorized;
await response.WriteAsJsonAsync(authResult);
}

return response;
Expand Down
8 changes: 4 additions & 4 deletions src/ByteSync.Functions/Http/CloudSessionFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task<HttpResponseData> Create([HttpTrigger(AuthorizationLevel.Anony
var cloudSessionResult = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(cloudSessionResult, HttpStatusCode.OK);
await response.WriteAsJsonAsync(cloudSessionResult);

return response;
}
Expand All @@ -44,7 +44,7 @@ public async Task<HttpResponseData> AskPasswordExchangeKey(
var parameters = await FunctionHelper.DeserializeRequestBody<AskCloudSessionPasswordExchangeKeyParameters>(req);
var result = await _mediator.Send(new AskPasswordExchangeKeyRequest(client, parameters), executionContext.CancellationToken);
var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);
return response;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ public async Task<HttpResponseData> FinalizeJoinCloudSession(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -86,7 +86,7 @@ public async Task<HttpResponseData> AskJoinCloudSession(
var parameters = await FunctionHelper.DeserializeRequestBody<AskJoinCloudSessionParameters>(req);
var result = await _mediator.Send(new AskJoinCloudSessionRequest(client, parameters));
var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);
return response;
}

Expand Down
8 changes: 4 additions & 4 deletions src/ByteSync.Functions/Http/CloudSessionProfileFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task<HttpResponseData> CreateCloudSessionProfile(
var result = await _cloudSessionProfileService.CreateCloudSessionProfile(sessionId, client);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -47,7 +47,7 @@ public async Task<HttpResponseData> GetCloudSessionProfileData(
var result = await _cloudSessionProfileService.GetCloudSessionProfileData(parameters, client);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -63,7 +63,7 @@ public async Task<HttpResponseData> GetProfileDetailsPassword([HttpTrigger(
var result = await _cloudSessionProfileService.GetProfileDetailsPassword(parameters, client);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -79,7 +79,7 @@ public async Task<HttpResponseData> DeleteCloudSessionProfile([HttpTrigger(
var result = await _cloudSessionProfileService.DeleteCloudSessionProfile(parameters, client);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand Down
8 changes: 4 additions & 4 deletions src/ByteSync.Functions/Http/FileTransferFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task<HttpResponseData> GetUploadFileUrl(
var url = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(url, HttpStatusCode.OK);
await response.WriteAsJsonAsync(url);

return response;
}
Expand All @@ -49,7 +49,7 @@ public async Task<HttpResponseData> GetUploadFileStorageLocation(
var request = new GetUploadFileStorageLocationRequest(sessionId, client, transferParameters);
var responseObject = await _mediator.Send(request);
var response = req.CreateResponse();
await response.WriteAsJsonAsync(responseObject, HttpStatusCode.OK);
await response.WriteAsJsonAsync(responseObject);

return response;
}
Expand All @@ -68,7 +68,7 @@ public async Task<HttpResponseData> GetDownloadFileUrl(
var url = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(url, HttpStatusCode.OK);
await response.WriteAsJsonAsync(url);

return response;
}
Expand All @@ -86,7 +86,7 @@ public async Task<HttpResponseData> GetDownloadFileStorageLocation(
var request = new GetDownloadFileStorageLocationRequest(sessionId, client, transferParameters);
var responseObject = await _mediator.Send(request);
var response = req.CreateResponse();
await response.WriteAsJsonAsync(responseObject, HttpStatusCode.OK);
await response.WriteAsJsonAsync(responseObject);

return response;
}
Expand Down
14 changes: 7 additions & 7 deletions src/ByteSync.Functions/Http/InventoryFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task<HttpResponseData> Start(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -53,7 +53,7 @@ public async Task<HttpResponseData> AddDataSource(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -74,7 +74,7 @@ public async Task<HttpResponseData> RemoveDataSource(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -92,7 +92,7 @@ public async Task<HttpResponseData> GetDataSources(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -112,7 +112,7 @@ public async Task<HttpResponseData> AddDataNode(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -132,7 +132,7 @@ public async Task<HttpResponseData> RemoveDataNode(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand All @@ -149,7 +149,7 @@ public async Task<HttpResponseData> GetDataNodes(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ByteSync.Functions/Http/LobbyFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<HttpResponseData> JoinLobby(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand Down
6 changes: 3 additions & 3 deletions src/ByteSync.Functions/Http/SessionMemberFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public async Task<HttpResponseData> GetMembersInstanceIds(
{
var result = await _mediator.Send(new GetMembersInstanceIdsRequest(sessionId));
var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);
return response;
}

Expand All @@ -35,7 +35,7 @@ public async Task<HttpResponseData> GetMembers(
{
var result = await _mediator.Send(new GetMembersRequest(sessionId));
var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);
return response;
}

Expand All @@ -53,7 +53,7 @@ public async Task<HttpResponseData> SetGeneralStatus(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
await response.WriteAsJsonAsync(result);

return response;
}
Expand Down
5 changes: 3 additions & 2 deletions src/ByteSync.Functions/Http/TrustFunction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Net;
using System.Net;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using ByteSync.Common.Business.Sessions.Cloud.Connections;
Expand Down Expand Up @@ -32,7 +32,8 @@ public async Task<HttpResponseData> StartTrustCheck(
var result = await _mediator.Send(request);

var response = req.CreateResponse();
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this handler the status code is no longer explicitly set after removing the WriteAsJsonAsync(HttpStatusCode) overload. If the intent is to follow the new pattern described in the PR (set StatusCode explicitly, then WriteAsJsonAsync), consider setting response.StatusCode = HttpStatusCode.OK before serializing for consistency with the other Trust endpoints.

Suggested change
var response = req.CreateResponse();
var response = req.CreateResponse();
response.StatusCode = HttpStatusCode.OK;

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I missed this one. The fix has been pushed: response.StatusCode is now explicitly set to HttpStatusCode.OK prior to serialization, perfectly matching the other Trust endpoints.

await response.WriteAsJsonAsync(result, HttpStatusCode.OK);
response.StatusCode = HttpStatusCode.OK;
await response.WriteAsJsonAsync(result);

return response;
}
Expand Down
Loading
Loading