[dotnet] [bidi] Use `System.Threading.Channels` dependency for events dispatching by nvborisenko · Pull Request #17004 · SeleniumHQ/selenium
| Security Compliance | |
| ⚪ | Denial of serviceDescription: An unbounded Referred Codeprivate readonly Channel<(string Method, EventArgs Params)> _pendingEvents = Channel.CreateUnbounded<(string Method, EventArgs Params)>(new(){ SingleReader = true, SingleWriter = true }); private readonly Dictionary<string, JsonTypeInfo> _eventTypesMap = []; private readonly ConcurrentDictionary<string, List<EventHandler>> _eventHandlers = new(); private long _currentCommandId; private static readonly TaskFactory _myTaskFactory = new(CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskContinuationOptions.None, TaskScheduler.Default); private Task? _receivingMessageTask; private Task? _eventEmitterTask; private CancellationTokenSource? _receiveMessagesCancellationTokenSource; internal Broker(BiDi bidi, Uri url) { _bidi = bidi; _transport = new WebSocketTransport(url); } public async Task ConnectAsync(CancellationToken cancellationToken) { ... (clipped 235 lines) |
| Ticket Compliance | |
| ⚪ | 🎫 No ticket provided
|
| Codebase Duplication Compliance | |
| ⚪ | Codebase context is not definedFollow the guide to enable codebase context checks. |
| Custom Compliance | |
| 🟢 |
Generic: Comprehensive Audit TrailsObjective: To create a detailed and reliable record of critical system actions for security analysis Status: Passed
|
Generic: Meaningful Naming and Self-Documenting CodeObjective: Ensure all identifiers clearly express their purpose and intent, making code Status: Passed
| |
Generic: Secure Error HandlingObjective: To prevent the leakage of sensitive system information through error messages while Status: Passed
| |
Generic: Security-First Input Validation and Data HandlingObjective: Ensure all data inputs are validated, sanitized, and handled securely to prevent Status: Passed
| |
| 🔴 | Generic: Robust Error Handling and Edge Case ManagementObjective: Ensure comprehensive error handling that provides meaningful context and graceful Status: Referred Codevar messageEvent = (method, eventArgs); _pendingEvents.Writer.TryWrite(messageEvent); }
|
| ⚪ | Generic: Secure Logging PracticesObjective: To ensure logs are useful for debugging and auditing without exposing sensitive Status: Referred Codecatch (Exception ex) { if (_logger.IsEnabled(LogEventLevel.Error)) { _logger.Error($"Unhandled error processing BiDi event handler: {ex}"); }
|
| |