Skip to content

Conversation

@Johnetordoff
Copy link
Contributor

@Johnetordoff Johnetordoff commented Oct 30, 2025

Purpose

Fix issue where node preferences don't appear on the node settings page.

Changes

  • add view-side filtering for subscriptions id
  • improve NotificationSubscription defaults
  • change NotificationSubscription to use correct type

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

assert put_res.status_code == 405
assert delete_res.status_code == 405

def test_multiple_values_filter(self, app, url, file_updated_notification, user):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we were adding the wrong type of notification before.

object_id=user.id,
content_type=ContentType.objects.get_for_model(user),
_is_digest=True,
message_frequency='instantly',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing message_frequency not strictly related to filtering issue, but necessary as NoneType values aren't recognized as default by FE.

NotificationSubscription(
user=contributor,
notification_type=NotificationType.Type.FILE_UPDATED.instance,
notification_type=NotificationType.Type.NODE_FILE_UPDATED.instance,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ultimately this was what was cause the issues, FILE_UPDATED is the item with the NODE_FILE_UPDATED digest.

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)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line is now not needed because subscription is now being correctly sent by the signal.

@Johnetordoff Johnetordoff marked this pull request as ready for review October 30, 2025 13:44
Copy link
Contributor

@opaduchak opaduchak left a comment

Choose a reason for hiding this comment

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

Great work, one minor issue

@Johnetordoff Johnetordoff merged commit 7b09dc4 into CenterForOpenScience:feature/notification-refactor-p2-s Oct 30, 2025
7 of 8 checks passed
@opaduchak
Copy link
Contributor

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants