[Feature:Notifications] Auto-Mark Gradeable Notification Status#12658
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
JManion32
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Should the down migration remove a data? Why not just leave it in the case of a rollback?
There was a problem hiding this comment.
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.
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 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. |
JManion32
left a comment
There was a problem hiding this comment.
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!
…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]>
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?
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).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