Skip to content

[Bugfix:Notifications] Misc Notification UI Bugfixes#12233

Merged
bmcutler merged 5 commits intomainfrom
unseen-count-hotfix
Dec 11, 2025
Merged

[Bugfix:Notifications] Misc Notification UI Bugfixes#12233
bmcutler merged 5 commits intomainfrom
unseen-count-hotfix

Conversation

@JManion32
Copy link
Contributor

@JManion32 JManion32 commented Dec 1, 2025

Why is this Change Important & Necessary?

There are several small bugs and code convention errors in the notification UI, mostly introduced by #12227. If necessary, this PR can be split into multiple smaller ones, but since all changes are minor and primarily contained in NotificationsDisplay.vue, I figured I would just address all of them in a single PR.

UI Issues

  1. Unseen notification count displayed when 0
    In the original PR, [Feature:Notifications] Home Page Additional Unseen Count #12227, I did not have a condition for when older notifications is equal to 0. This meant if the user had an unseen notification displayed, the older notifications count would always be visible, even when it was 0.

  2. "No unseen notifications" not appearing dynamically when course notifications are cleared
    If the user marks an individual course notification as seen and then clears all of them, the "No unseen notifications" text would not appear until after a reload. This is because the course notification's prop for unseenCount is set to 0, meaning it becomes negative if notifications are marked seen, and thus preventing the text from displaying.

Developer Convention Issues

  1. Using Incorrect Notification Arrays
    NotificationsDisplay.vue contains 3 notification lists:
  • localNotifications - all notifications sent from the backend
  • filteredNotifications - filtered version of localNotifications that is either unseen only, or all based on local storage variable
  • visibleNotifications - filtered version of filteredNotifications - all for courses, 10 most recent for home page.
    When referring to displayed notifications, you should use visibleNotifications. When manipulating the data in notifications (i.e., mark seen), you should use localNotifications, since the updates will propogate to the other arrays from there.

The logic introduced in #12227 uses filteredNotifications. I don't think this affects the functionality, but it is still not the correct convention.

  1. Inconsistent Logic
    The individual mark seen logic does not match the mark all as seen logic.

  2. Using semester instead of term
    Submitty uses term, not semester. In [Feature:Notifications] Display All Notifications on Home Page #11914, the first PR for the new notifications UI, I used semester. In more recent PRs such as [Feature:Notifications] Home Page Mark All Seen Popup #12219, I used the correct Submitty convention, term, leading to code inconsistencies.

What is the New Behavior?

  1. Unseen notification count displayed when 0
    Added a condition to ensure the count is not displayed when it is 0.

Before

Screenshot from 2025-12-01 15-21-14

After

Screenshot from 2025-12-01 15-24-13
  1. "No unseen notifications" not appearing dynamically when course notifications are cleared
    Rather than checking if unseenCount is equal to 0, check if unseenCount is <= 0.

  2. Using Incorrect Notification Arrays
    Use visibleNotifications for the unseen count logic instead of filteredNotifications. Move arrays to be next to each other and adjust comments to make it more apparent which one should be used.

  3. Inconsistent Logic
    Use a for loop for both individual mark seen and mark all as seen.

  4. Using semester instead of term
    Changed all instances of semester in the notification UI to term.

What steps should a reviewer take to reproduce or test the bug or new feature?

Play around with the notifications UI and ensure there are no other odd behaviors.

Other information

This is not a breaking change.

Minor Bug Discovery

In my testing, I discovered a possible race condition with clearing individual notifications. When the user has many notifications and attempts to rapidly clear them one at a time, it is possible for a notification to appear as seen, but persist as the 11th notification in the unseen only panel.
Screenshot from 2025-12-01 17-16-42
This seems to occur when there is a high volume of mark_seen network requests, causing them to return out of order. The solution would be to block each individual mark seen button until each request is completed, but I believe that would be too much overhead for such a minor issue.

This should not occur often, as users with many notifications should clear them using Mark as seen. Additionally, the issue can be solved with a simple reload, and does not occur if the user is using the notification UI as intended / not individually clearing 10+ notifications at a time.

@github-project-automation github-project-automation bot moved this to Seeking Reviewer in Submitty Development Dec 1, 2025
@automateprojectmangement automateprojectmangement bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Dec 1, 2025
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.69%. Comparing base (9ce63f0) to head (9eff47b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12233   +/-   ##
=========================================
  Coverage     21.69%   21.69%           
  Complexity     9617     9617           
=========================================
  Files           268      268           
  Lines         36113    36113           
  Branches        478      478           
=========================================
  Hits           7835     7835           
  Misses        27804    27804           
  Partials        474      474           
Flag Coverage Δ
autograder 21.39% <ø> (ø)
js 2.07% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.69% <0.00%> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 90.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JManion32 JManion32 changed the title [Bugfix:Notifications] Only Display when Unseen Count > 0 [Bugfix:Notifications] Notification UI Hotfixes Dec 1, 2025
@JManion32 JManion32 marked this pull request as ready for review December 2, 2025 00:30
@automateprojectmangement automateprojectmangement bot moved this from Work in Progress to Seeking Reviewer in Submitty Development Dec 2, 2025
@RyanStyron RyanStyron self-assigned this Dec 2, 2025
Copy link
Contributor

@Rkoester47 Rkoester47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested these hotfixes and can confirm that the issue with displaying 0 older notifications is no longer present for me. I attempted to recreate the race issue you described at the bottom of the PR, but was unable to reproduce it on my end. The other features of notifications, such as mark all as seen and marking as seen within course notifications, seem to be untouched. I think the changes in the code to make it more consistent with previous Submitty code is a good choice. Overall, great work quickly addressing these bugs!

@github-project-automation github-project-automation bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Dec 2, 2025
Copy link
Contributor

@RyanStyron RyanStyron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the changes appear to have created unintended bugs based on testing. I appreciate the updates for consistency. Great job.

Additional note: I was able to reproduce the issue described with respect to there not being a dynamic update after clearing notifications when there are initially many notifications, but I agree that it is not urgent.

@JManion32 JManion32 changed the title [Bugfix:Notifications] Notification UI Hotfixes [Bugfix:Notifications] Misc Notification UI Bugfixes Dec 9, 2025
@bmcutler bmcutler merged commit 3f7774a into main Dec 11, 2025
51 of 52 checks passed
@bmcutler bmcutler deleted the unseen-count-hotfix branch December 11, 2025 04:34
JManion32 added a commit that referenced this pull request Jan 16, 2026
The original PR, #12233, left this refactor incomplete, preventing dynamic mark all as seen.
bmcutler pushed a commit that referenced this pull request Jan 16, 2026
### Why is this Change Important & Necessary?
In #12233, I made an effort to refactor the notifications system to use
`term` instead of `semester`, to maintain consistency with the rest of
the site. Unfortunately, I missed several files, resulting in each
notification having an `undefined` term. As a result, `markAllSeen()`,
which uses `term` to find the notifications to clear, was unable to
update the page dynamically.

### What is the New Behavior?
Convertedall instances of `semester` to `term` within the notification
system.

### What steps should a reviewer take to reproduce or test the bug or
new feature?
**On main:**
Observe that `markAllSeen` works upon reload, but does not update the
page dynamically. If you want to take it a step further, you can do
`console.log(n.term)` inside of the function, and observe that it is
always `undefined`.

**On my branch:**
Observer that `markAllSeen`, and all other functionality of the
notifications UI is dynamic. `n.term` is now `s26`.

### Automated Testing & Documentation
There is currently no complete E2E testing of the notification system
(#11908). With the new user interface now complete, this will be my next
priority.

### Other information
This is not a breaking change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants