[ENG-9664] Fix node subscriptions API filtering#11405
Merged
Johnetordoff merged 3 commits intoCenterForOpenScience:feature/notification-refactor-p2-sfrom Oct 30, 2025
Conversation
Johnetordoff
commented
Oct 30, 2025
| assert put_res.status_code == 405 | ||
| assert delete_res.status_code == 405 | ||
|
|
||
| def test_multiple_values_filter(self, app, url, file_updated_notification, user): |
Contributor
Author
There was a problem hiding this comment.
Since we were adding the wrong type of notification before.
Johnetordoff
commented
Oct 30, 2025
| object_id=user.id, | ||
| content_type=ContentType.objects.get_for_model(user), | ||
| _is_digest=True, | ||
| message_frequency='instantly', |
Contributor
Author
There was a problem hiding this comment.
Changing message_frequency not strictly related to filtering issue, but necessary as NoneType values aren't recognized as default by FE.
Johnetordoff
commented
Oct 30, 2025
| NotificationSubscription( | ||
| user=contributor, | ||
| notification_type=NotificationType.Type.FILE_UPDATED.instance, | ||
| notification_type=NotificationType.Type.NODE_FILE_UPDATED.instance, |
Contributor
Author
There was a problem hiding this comment.
Ultimately this was what was cause the issues, FILE_UPDATED is the item with the NODE_FILE_UPDATED digest.
Johnetordoff
commented
Oct 30, 2025
| assert subs.filter(object_id=obj.id, content_type=content_type).exists() | ||
|
|
||
| def test_migrate_node_subscription(self, users, user, node): | ||
| self.create_legacy_sub('file_updated', users, user=user, node=node) |
Contributor
Author
There was a problem hiding this comment.
This line is now not needed because subscription is now being correctly sent by the signal.
opaduchak
suggested changes
Oct 30, 2025
Contributor
opaduchak
left a comment
There was a problem hiding this comment.
Great work, one minor issue
7b09dc4
into
CenterForOpenScience:feature/notification-refactor-p2-s
7 of 8 checks passed
Contributor
|
LGTM! |
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.
Purpose
Fix issue where node preferences don't appear on the node settings page.
Changes
QA Notes
Needs minor FE change: CenterForOpenScience/angular-osf#734
What are the areas of risk?
Any concerns/considerations/questions that development raised?
Documentation
Side Effects
Ticket
https://openscience.atlassian.net/browse/ENG-9664