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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/// </list>
/// <para><strong>Execution Behavior:</strong></para>
/// Priority groups execute sequentially in ascending priority order. Within each group, handlers
/// execute in parallel using <see cref="System.Threading.Tasks.Parallel"/>.
/// execute in parallel using <see cref="Parallel"/>.
/// This ensures predictable ordering between groups while maximising throughput within each group.
/// <para><strong>Error Handling:</strong></para>
/// Individual handler failures do not prevent other handlers from executing, including handlers
Expand Down
10 changes: 5 additions & 5 deletions src/NetEvolve.Pulse/Interceptors/LoggingMessages.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetEvolve.Pulse.Interceptors;
namespace NetEvolve.Pulse.Interceptors;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check for UTF-8 BOM in C# source files

# Find all C# files with BOM (EF BB BF byte sequence)
echo "=== C# files with UTF-8 BOM ==="
fd -e cs -x bash -c 'if [ "$(head -c 3 "{}" | od -An -tx1 | tr -d " ")" = "efbbbf" ]; then echo "{}"; fi'

echo ""
echo "=== Total count ==="
fd -e cs -x bash -c 'if [ "$(head -c 3 "{}" | od -An -tx1 | tr -d " ")" = "efbbbf" ]; then echo "1"; fi' | wc -l

Repository: dailydevops/pulse

Length of output: 16944


🏁 Script executed:

#!/bin/bash
# Check for UTF-8 BOM in C# files using Python
python3 << 'EOF'
import os
import glob

# Find all C# files
csharp_files = glob.glob('**/*.cs', recursive=True)

# Check for BOM (first 3 bytes: EF BB BF)
bom_files = []
target_file = 'src/NetEvolve.Pulse/Interceptors/LoggingMessages.cs'

for filepath in csharp_files:
    try:
        with open(filepath, 'rb') as f:
            first_bytes = f.read(3)
            if first_bytes == b'\xef\xbb\xbf':
                bom_files.append(filepath)
    except:
        pass

print("=== C# files with UTF-8 BOM ===")
if bom_files:
    for f in sorted(bom_files):
        print(f)
else:
    print("(none found)")

print(f"\n=== Total count: {len(bom_files)} ===")

# Specifically check the target file
print(f"\n=== Checking target file: {target_file} ===")
if os.path.exists(target_file):
    with open(target_file, 'rb') as f:
        first_bytes = f.read(3)
        has_bom = first_bytes == b'\xef\xbb\xbf'
        print(f"Has BOM: {has_bom}")
        print(f"First bytes (hex): {first_bytes.hex()}")
        print(f"First 50 chars: {first_bytes + open(target_file, 'rb').read(50)[:47]}")
else:
    print(f"File not found")
EOF

Repository: dailydevops/pulse

Length of output: 11349


Remove UTF-8 BOM from C# files across the codebase.

UTF-8 Byte Order Marks (BOMs) have been added to 159 C# files including this one. BOMs are unnecessary for C# source files and cause issues with tooling, version control diffs, and cross-platform compatibility. Remove the BOM from all affected files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/NetEvolve.Pulse/Interceptors/LoggingMessages.cs` at line 1, The file
contains a UTF-8 Byte Order Mark (BOM) at the start which should be removed;
open src/NetEvolve.Pulse/Interceptors/LoggingMessages.cs (namespace
NetEvolve.Pulse.Interceptors / file LoggingMessages.cs) and re-save the file as
UTF-8 without BOM (e.g., using your editor’s “Save with Encoding” → UTF-8
without BOM or run a script to strip the BOM), then ensure other affected C#
files are saved the same way and commit the changes so diffs/tooling no longer
include the BOM.


using Microsoft.Extensions.Logging;

Expand Down Expand Up @@ -58,7 +58,7 @@ internal static partial void LogErrorHandle(
/// Logs the beginning of a stream query enumeration.
/// </summary>
/// <remarks>
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when enumeration of an <see cref="NetEvolve.Pulse.Extensibility.IStreamQuery{TResponse}"/> starts.
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when enumeration of an <see cref="Extensibility.IStreamQuery{TResponse}"/> starts.
/// </remarks>
[LoggerMessage(Message = "Streaming '{StreamQueryName}' (CorrelationId: {CorrelationId})")]
internal static partial void LogBeginStreamQuery(
Expand All @@ -72,7 +72,7 @@ internal static partial void LogBeginStreamQuery(
/// Logs the successful completion of a stream query enumeration.
/// </summary>
/// <remarks>
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when an <see cref="NetEvolve.Pulse.Extensibility.IStreamQuery{TResponse}"/> sequence is fully consumed.
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when an <see cref="Extensibility.IStreamQuery{TResponse}"/> sequence is fully consumed.
/// </remarks>
[LoggerMessage(Message = "Streamed '{StreamQueryName}' in {ElapsedMs:F2}ms (CorrelationId: {CorrelationId})")]
internal static partial void LogEndStreamQuery(
Expand All @@ -87,7 +87,7 @@ internal static partial void LogEndStreamQuery(
/// Logs a warning when a stream query exceeds the configured slow-stream threshold.
/// </summary>
/// <remarks>
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when an <see cref="NetEvolve.Pulse.Extensibility.IStreamQuery{TResponse}"/> exceeds the slow threshold.
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when an <see cref="Extensibility.IStreamQuery{TResponse}"/> exceeds the slow threshold.
/// </remarks>
[LoggerMessage(
Level = LogLevel.Warning,
Expand All @@ -105,7 +105,7 @@ internal static partial void LogSlowStreamQuery(
/// Logs an error when a stream query fails during enumeration.
/// </summary>
/// <remarks>
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when an <see cref="NetEvolve.Pulse.Extensibility.IStreamQuery{TResponse}"/> throws an exception.
/// Emitted by <c>LoggingStreamQueryInterceptor</c> when an <see cref="Extensibility.IStreamQuery{TResponse}"/> throws an exception.
/// </remarks>
[LoggerMessage(
Level = LogLevel.Error,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
namespace NetEvolve.Pulse.Tests.Unit;
namespace NetEvolve.Pulse.Tests.Unit;

using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Interceptors;
using NetEvolve.Pulse.Internals;
using TUnit.Assertions;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("ActivityMetrics")]
public sealed class ActivityMetricsExtensionsTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
namespace NetEvolve.Pulse.Tests.Unit.AspNetCore;
namespace NetEvolve.Pulse.Tests.Unit.AspNetCore;

using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility;
using TUnit.Core;
using PulseEndpoints = EndpointRouteBuilderExtensions;

[TestGroup("AspNetCore")]
public sealed class EndpointRouteBuilderExtensionsTests
{
// Represents an undefined CommandHttpMethod value used to verify validation behaviour.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility;
using TUnit.Core;

[TestGroup("AssemblyScanning")]
public class AssemblyScanningExtensionsTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
namespace NetEvolve.Pulse.Tests.Unit.AzureServiceBus;
namespace NetEvolve.Pulse.Tests.Unit.AzureServiceBus;

using Azure.Core;
using Azure.Identity;
using Azure.Messaging.ServiceBus;
using Microsoft.Extensions.DependencyInjection;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("AzureServiceBus")]
public sealed class AzureServiceBusExtensionsTests
{
private const string FakeConnectionString =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
namespace NetEvolve.Pulse.Tests.Unit.AzureServiceBus;
namespace NetEvolve.Pulse.Tests.Unit.AzureServiceBus;

using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Azure.Messaging.ServiceBus;
using Microsoft.Extensions.Options;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("AzureServiceBus")]
public sealed class AzureServiceBusMessageTransportTests
{
private const string FakeConnectionString =
Expand Down Expand Up @@ -414,7 +416,7 @@ public override Task SendMessagesAsync(
CancellationToken cancellationToken = default
)
{
BatchedMessages.Add(messages.ToList());
BatchedMessages.Add([.. messages]);
return Task.CompletedTask;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("Dapr")]
public sealed class DaprExtensionsTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
using System.Threading.Tasks;
using global::Dapr.Client;
using Microsoft.Extensions.Options;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("Dapr")]
public sealed class DaprMessageTransportTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
namespace NetEvolve.Pulse.Tests.Unit.Dispatchers;

using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Dispatchers;
using NetEvolve.Pulse.Extensibility;
using TUnit.Core;

[TestGroup("Dispatchers")]
public class ParallelEventDispatcherTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

using System.Collections.Concurrent;
using System.Threading.Tasks;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Dispatchers;
using NetEvolve.Pulse.Extensibility;
using TUnit.Core;

/// <summary>
/// Unit tests for <see cref="PrioritizedEventDispatcher"/>.
/// </summary>
[TestGroup("Dispatchers")]
public class PrioritizedEventDispatcherTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

using System.Collections.Concurrent;
using System.Threading.Tasks;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Dispatchers;
using NetEvolve.Pulse.Extensibility;
using TUnit.Core;

/// <summary>
/// Unit tests for <see cref="RateLimitedEventDispatcher"/>.
/// </summary>
[TestGroup("Dispatchers")]
public class RateLimitedEventDispatcherTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
namespace NetEvolve.Pulse.Tests.Unit.Dispatchers;

using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Dispatchers;
using NetEvolve.Pulse.Extensibility;
using TUnit.Core;

[TestGroup("Dispatchers")]
public class SequentialEventDispatcherTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class EntityFrameworkEventOutboxTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
namespace NetEvolve.Pulse.Tests.Unit.EntityFramework;
namespace NetEvolve.Pulse.Tests.Unit.EntityFramework;

using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Core;
using TUnit.Mocks;

[TestGroup("EntityFramework")]
public sealed class EntityFrameworkExtensionsTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class EntityFrameworkOutboxManagementTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Outbox;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class EntityFrameworkOutboxRepositoryTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Outbox;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class EntityFrameworkOutboxTransactionScopeTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class ModelBuilderExtensionsTests
{
[Test]
Expand All @@ -18,7 +20,7 @@ public async Task ApplyPulseConfiguration_When_modelBuilder_is_null_throws_Argum
await using var context = new TestDbContext(options);

_ = await Assert
.That(() => ModelBuilderExtensions.ApplyPulseConfiguration<TestDbContext>(null!, context))
.That(() => ModelBuilderExtensions.ApplyPulseConfiguration(null!, context))
.Throws<ArgumentNullException>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Configurations;
using NetEvolve.Pulse.Outbox;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class OutboxMessageConfigurationFactoryTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Options;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Extensibility.Outbox;
using NetEvolve.Pulse.Outbox;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class OutboxMessageConfigurationMetadataTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

using System;
using System.Threading.Tasks;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Configurations;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("EntityFramework")]
public sealed class TypeValueConverterTests
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
namespace NetEvolve.Pulse.Tests.Unit;
namespace NetEvolve.Pulse.Tests.Unit;

using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using NetEvolve.Extensions.TUnit;
using NetEvolve.Pulse.Dispatchers;
using NetEvolve.Pulse.Extensibility;
using NetEvolve.Pulse.Internals;
using TUnit.Assertions;
using TUnit.Assertions.Extensions;
using TUnit.Core;

[TestGroup("Dispatchers")]
public sealed class EventDispatcherExtensionsTests
{
[Test]
Expand Down
Loading
Loading