Skip to content

[Feature:Notifications] Auto-Mark Gradeable Notification Status#12658

Merged
bmcutler merged 15 commits into
mainfrom
sync-gradeable-notifications
Apr 10, 2026
Merged

[Feature:Notifications] Auto-Mark Gradeable Notification Status#12658
bmcutler merged 15 commits into
mainfrom
sync-gradeable-notifications

Conversation

@jeffrey-cordero

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Students previously had to manually click a notification or visit the notification page to mark gradeable release and grade release notifications when visiting the respective page via a link, which is a poor-quality-of-life experience.

What is the New Behavior?

When a student visits a gradeable page, any unseen grading notifications for that gradeable (submission open or grade release) are automatically marked as seen in a single database update.

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

  1. Run the respective course migration.
  2. Trigger a gradeable release or grade release notification via send_notification.py (udo -u "submitty_daemon" python3 sbin/send_notification.py: [Feature:Notifications] Released Gradeable Notification #11897 and [Feature:Notifications] Released grade notification #10358 have more in-depth explanations).
  3. Log in as the notified student (notification bell should show unread).
  4. Navigate to the gradeable page.
  5. Verify the notification is now marked as seen (bell clears, notification panel shows read).

Automated Testing & Documentation

Unit tests have been added, but an issue will be made to extend this notification feature to end-to-end testing coverage.

Other information

N/A

@codecov

codecov Bot commented Mar 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.94595% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.73%. Comparing base (b2db10a) to head (433b1eb).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12658      +/-   ##
============================================
+ Coverage     21.64%   21.73%   +0.09%     
- Complexity     9654     9660       +6     
============================================
  Files           268      268              
  Lines         36244    36273      +29     
  Branches        487      487              
============================================
+ Hits           7845     7884      +39     
+ Misses        27916    27906      -10     
  Partials        483      483              
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.04% <ø> (ø)
migrator 100.00% <100.00%> (ø)
php 20.77% <44.44%> (+0.10%) ⬆️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

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.

@roye2
roye2 self-requested a review March 27, 2026 00:56
@automateprojectmangement automateprojectmangement Bot moved this from Seeking Reviewer to In Review in Submitty Development Mar 27, 2026
@roye2
roye2 removed their request for review March 27, 2026 00:57

@JManion32 JManion32 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a great quality of life change. I see many students with uncleared notifications, so I like the idea of having a system in place to automatically clear them.

I was unable to replicate the fix with existing notifications (from before I switched to the branch) and new notifications that I pushed with sudo -u "submitty_daemon" python3 sbin/send_notification.p

Also, just a thought. Should we add the gradeable_id field to Notification.ts? It won't get used, but since we are updating the serialize function and sending it, maybe we should.

)
database.execute(
"""
ALTER TABLE notifications DROP COLUMN IF EXISTS gradeable_id

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should the down migration remove a data? Why not just leave it in the case of a rollback?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can clear the down migration. The tied gradeable ID value seemed simple to apply, so clearing it made sense at the time to save space.

Comment thread migration/migrator/dumper.py
@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Mar 27, 2026
@jeffrey-cordero

Copy link
Copy Markdown
Contributor Author

This is a great quality of life change. I see many students with uncleared notifications, so I like the idea of having a system in place to automatically clear them.

I was unable to replicate the fix with existing notifications (from before I switched to the branch) and new notifications that I pushed with sudo -u "submitty_daemon" python3 sbin/send_notification.p

Also, just a thought. Should we add the gradeable_id field to Notification.ts? It won't get used, but since we are updating the serialize function and sending it, maybe we should.

You ran the migration and updated the server code and still couldn't get notifications to be marked as seen when visiting the respective gradeable submission page? Adding the field makes sense if icons for gradeables are differentiated on the front end or just to be consistent with other features, otherwise it seems like wasted bytes over the network. Are gradeable notification icons unique?

@JManion32

Copy link
Copy Markdown
Contributor

You ran the migration and updated the server code and still couldn't get notifications to be marked as seen when visiting the respective gradeable submission page? Adding the field makes sense if icons for gradeables are differentiated on the front end or just to be consistent with other features, otherwise it seems like wasted bytes over the network. Are gradeable notification icons unique?

Okay, this clears things up for me and yes, I am able to replicate the feature.

Leaving the gradeable_id field out makes sense to me as well.

The only uncertainty I have now is with the "backfill" migration. Notifications that were created before running the migration do not get marked as seen when I go to that gradeable's submission page. Am I misunderstanding how this should work?

@jeffrey-cordero

Copy link
Copy Markdown
Contributor Author

You ran the migration and updated the server code and still couldn't get notifications to be marked as seen when visiting the respective gradeable submission page? Adding the field makes sense if icons for gradeables are differentiated on the front end or just to be consistent with other features, otherwise it seems like wasted bytes over the network. Are gradeable notification icons unique?

Okay, this clears things up for me and yes, I am able to replicate the feature.

Leaving the gradeable_id field out makes sense to me as well.

The only uncertainty I have now is with the "backfill" migration. Notifications that were created before running the migration do not get marked as seen when I go to that gradeable's submission page. Am I misunderstanding how this should work?

This is exactly how it should work. I tested with both new gradeables and all base gradeable notifications that are seeded by the notification script after a fresh vagrant up. SELECT * FROM notifications WHERE gradeable_id IS NOT NULL LIMIT 100; within the SQL Toolbox should be non-empty with a variety of unique users after the migration script is run.

@jeffrey-cordero jeffrey-cordero moved this from Work in Progress to In Review in Submitty Development Mar 28, 2026

@JManion32 JManion32 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Functionality is as expected and code code changes are reasonable. I verified that both new notifications and existing ones will always have gradeable_id attached after the migration runs. Great work!

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Mar 31, 2026
@bmcutler
bmcutler merged commit 6c55ef3 into main Apr 10, 2026
24 of 25 checks passed
@bmcutler
bmcutler deleted the sync-gradeable-notifications branch April 10, 2026 19:07
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development Apr 10, 2026
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Apr 13, 2026
…itty#12658)

### Why is this Change Important & Necessary?

Students previously had to manually click a notification or visit the
notification page to mark gradeable release and grade release
notifications when visiting the respective page via a link, which is a
poor-quality-of-life experience.

### What is the New Behavior?

When a student visits a gradeable page, any unseen grading notifications
for that gradeable (submission open or grade release) are automatically
marked as seen in a single database update.

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

1. Run the respective course migration.
2. Trigger a gradeable release or grade release notification via
`send_notification.py` (`udo -u "submitty_daemon" python3
sbin/send_notification.py`: Submitty#11897 and Submitty#10358 have more in-depth
explanations).
3. Log in as the notified student (notification bell should show
unread).
4. Navigate to the gradeable page.
5. Verify the notification is now marked as seen (bell clears,
notification panel shows read).

### Automated Testing & Documentation
<!-- Is this feature sufficiently tested by unit tests and end-to-end
tests?
If this PR does not add/update the necessary automated tests, write a
new GitHub issue and link it below.
Is this feature sufficiently documented on submitty.org?
Link related PRs or new GitHub issue to update documentation. -->

Unit tests have been added, but an issue will be made to extend this
notification feature to end-to-end testing coverage.

### Other information

N/A

---------

Co-authored-by: Justin Manion <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants