Skip to content

Commit cdbdda0

Browse files
committed
More from coderabbit
1 parent b793fe4 commit cdbdda0

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

src/js/msp/msp_debug_dashboard.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,15 @@ export class MSPDebugDashboard {
464464
this.showTestDetails(testIndex);
465465
}
466466
}
467+
468+
// Handle close details button clicks
469+
if (e.target.classList.contains("close-details-btn")) {
470+
const testDetails = e.target.closest(".test-details");
471+
if (testDetails) {
472+
testDetails.remove();
473+
this.pauseUpdates(1000);
474+
}
475+
}
467476
}
468477
});
469478

@@ -1100,7 +1109,7 @@ export class MSPDebugDashboard {
11001109
`
11011110
: ""
11021111
}
1103-
<button onclick="this.parentElement.remove(); window.MSPDebug.dashboard.pauseUpdates(1000);"
1112+
<button class="close-details-btn"
11041113
style="margin-top: 10px; padding: 5px 10px; background: #666; color: white; border: none; border-radius: 3px; cursor: pointer;">
11051114
Close Details
11061115
</button>

src/js/msp/msp_test_runner.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ export const MSPTestRunner = {
220220
async quickHealthCheck() {
221221
console.log("🏥 Running Quick MSP Health Check...");
222222

223+
if (!window.MSP) {
224+
console.error("MSP not available");
225+
return { status: "ERROR", error: "MSP not initialized" };
226+
}
227+
223228
// Start monitoring briefly
224229
mspQueueMonitor.startMonitoring(100);
225230

@@ -291,7 +296,12 @@ export const MSPTestRunner = {
291296
const startTime = Date.now();
292297

293298
while (Date.now() - startTime < 5000) {
294-
promises.push(window.MSP.promise(101, null).catch(() => {}));
299+
promises.push(
300+
window.MSP.promise(101, null).catch((err) => {
301+
console.error("MSP request failed in sustained-load scenario:", err);
302+
return { error: err.message || "Unknown error" };
303+
}),
304+
);
295305
await new Promise((resolve) => setTimeout(resolve, 10));
296306
}
297307

@@ -330,7 +340,12 @@ export const MSPTestRunner = {
330340
for (let i = 0; i < 30; i++) {
331341
const code = codes[i % codes.length];
332342
const data = i % 4 === 0 ? new Uint8Array([i, i + 1, i + 2]) : null;
333-
promises.push(window.MSP.promise(code, data).catch(() => {}));
343+
promises.push(
344+
window.MSP.promise(code, data).catch((err) => {
345+
console.error(`MSP request failed in mixed-load scenario (code: ${code}):`, err);
346+
return { error: err.message || "Unknown error" };
347+
}),
348+
);
334349
}
335350

336351
const startTime = Date.now();

0 commit comments

Comments
 (0)