Skip to content

Commit dac988a

Browse files
author
rhamlett_microsoft
committed
Fixed logic to clear Active Simulations bar on crash and reset.
1 parent e74a490 commit dac988a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/PerfProblemSimulator/wwwroot/js/dashboard.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ function handleMetricsUpdate(snapshot) {
153153
if (snapshot.processId) {
154154
if (state.lastProcessId !== null && state.lastProcessId !== snapshot.processId) {
155155
logEvent('danger', `🔄 APPLICATION RESTARTED! Process ID changed from ${state.lastProcessId} to ${snapshot.processId}. This may indicate an unexpected crash (OOM, StackOverflow, etc.)`);
156+
// Clear all active simulations since the app restarted
157+
clearAllActiveSimulations();
156158
}
157159
state.lastProcessId = snapshot.processId;
158160
}
@@ -1001,10 +1003,20 @@ async function resetAll() {
10011003
if (response.ok) {
10021004
const result = await response.json();
10031005
logEvent('success', `🔄 Reset complete: ${result.memoryBlocksReleased} memory blocks released`);
1006+
// Clear all active simulations from the UI
1007+
clearAllActiveSimulations();
10041008
} else {
10051009
logEvent('error', 'Reset failed');
10061010
}
10071011
} catch (error) {
10081012
logEvent('error', `Reset error: ${error.message}`);
10091013
}
10101014
}
1015+
1016+
/**
1017+
* Clear all active simulations from state and UI.
1018+
*/
1019+
function clearAllActiveSimulations() {
1020+
state.activeSimulations.clear();
1021+
updateActiveSimulationsUI();
1022+
}

0 commit comments

Comments
 (0)