fix(test-timer): slow timer notification reappearing after new test (@J-Karthikeyan)#7808
Open
J-Karthikeyan wants to merge 2 commits intomonkeytypegame:masterfrom
Open
fix(test-timer): slow timer notification reappearing after new test (@J-Karthikeyan)#7808J-Karthikeyan wants to merge 2 commits intomonkeytypegame:masterfrom
J-Karthikeyan wants to merge 2 commits intomonkeytypegame:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a UX issue in the frontend test flow where a “slow timer” error notification could persist in the notification store and reappear after later tests, even though it wasn’t re-triggered.
Changes:
- Track the notification ID produced when the slow timer failure fires.
- Clear any previously-created slow-timer error notifications when a new test starts.
- Update notification helpers to return the created notification ID (to enable targeted removal).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/ts/test/test-timer.ts | Tracks slow-timer error notification IDs and removes them at TestTimer.start() to prevent reappearing stale errors. |
| frontend/src/ts/states/notifications.ts | Returns notifId from addNotificationWithLevel and selected convenience helpers so callers can later remove specific notifications. |
Comments suppressed due to low confidence (1)
frontend/src/ts/states/notifications.ts:193
- Return types now differ across convenience helpers: showNoticeNotification/showErrorNotification return notifId, but showSuccessNotification stays void. This makes the API inconsistent and can create awkward unions when selecting a helper dynamically. Consider returning notifId from showSuccessNotification too, or keep all show* helpers void and expose a separate "add..." API for callers needing the id.
export function showNoticeNotification(
message: string,
options?: AddNotificationOptions,
): number {
return addNotificationWithLevel(message, "notice", options);
}
export function showSuccessNotification(
message: string,
options?: AddNotificationOptions,
): void {
addNotificationWithLevel(message, "success", options);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a test fails due to the slow timer, the error notification ("Stopping the test due to bad performance...") has no auto dismiss timeout so it stays in the notification store indefinitely so it reappears once the next test is completed.
When we start a new test, the notification gets visually hidden by focus mode (non important notifications get a
hiddenclass when getFocus() is true). When the test ends, focus mode turns off and the notification reappears making it look like it fired again when it didn't.Steps to Reproduce
Fix
Fix: track the error notification's ID when the slow timer fires, and remove it from the store when a new test starts via TestTimer.start().