@@ -130,7 +130,7 @@ public async Task RequestMetrics()
130130 /// Used when the dashboard page loads or user interacts with it.
131131 /// </summary>
132132 [ UsedImplicitly ]
133- public async Task WakeUp ( )
133+ public Task WakeUp ( )
134134 {
135135 var wasIdle = _idleStateService . WakeUp ( ) ;
136136
@@ -139,19 +139,12 @@ public async Task WakeUp()
139139 _logger . LogInformation ( "Server woken up by client request from: {ConnectionId}" , Context . ConnectionId ) ;
140140 }
141141
142- // Always send current idle state directly to the caller.
143- // When waking from idle, the broadcast via MetricsBroadcastService may be
144- // delayed (queued on the dedicated broadcast thread), so we must send
145- // the updated state directly to ensure the client knows we're active.
146- var idleData = new IdleStateData
147- {
148- IsIdle = false ,
149- Message = wasIdle
150- ? "App waking up from idle state. There may be gaps in diagnostics and logs."
151- : "Application is active" ,
152- Timestamp = DateTimeOffset . UtcNow
153- } ;
154- await Clients . Caller . ReceiveIdleState ( idleData ) ;
142+ // Do NOT send ReceiveIdleState directly here.
143+ // The WakingUp event fired by IdleStateService.WakeUp() is handled by
144+ // MetricsBroadcastService, which broadcasts ReceiveIdleState to all clients.
145+ // Sending it here as well would cause the caller to receive the wake
146+ // message twice (once direct, once broadcast), duplicating the event log entry.
147+ return Task . CompletedTask ;
155148 }
156149
157150 /// <summary>
0 commit comments