Skip to content

AO3-5696 Disable orphan account user subscription emails#5758

Open
pmonfort wants to merge 3 commits intootwcode:masterfrom
pmonfort:AO3-5696-fix-orphan-account-chapter-subscription-emails
Open

AO3-5696 Disable orphan account user subscription emails#5758
pmonfort wants to merge 3 commits intootwcode:masterfrom
pmonfort:AO3-5696-fix-orphan-account-chapter-subscription-emails

Conversation

@pmonfort
Copy link
Copy Markdown
Contributor

Issue

https://otwarchive.atlassian.net/browse/AO3-5696

Purpose

When orphan_account is a co-creator on a multi-chapter work and another co-creator posts a new chapter without listing orphan_account, users subscribed to orphan_account incorrectly receive subscription emails.

The existing check in Subscription#valid_notification_entry? only inspects the creation's (chapter's) pseuds, missing the case where orphan_account is a co-creator at the work level but not on the individual chapter.

Added a guard that skips notifications when the subscription is to orphan_account directly. Subscribers of other co-creators on the same work are not affected.

Testing Instructions

  1. Subscribe to orphan_account
  2. Create a work with orphan_account as co-creator
  3. Post a new chapter without adding orphan_account as chapter co-creator
  4. Run bundle exec rake notifications:deliver_subscriptions
  5. Verify no subscription email is sent to the subscriber of orphan_account
  6. Verify that subscribers of the other co-creator still receive emails

References

Related to AO3-3620 (Allow subscriptions to orphan_account to receive notifications). When AO3-3620 is fixed, the two
User.orphan_account guards in valid_notification_entry? should be removed.

Credit

Pablo Monfort (he/him)

@sarken sarken changed the title Ao3 5696 fix orphan account chapter subscription emails AO3-5696 fix orphan account chapter subscription emails Apr 25, 2026
@redsummernight redsummernight changed the title AO3-5696 fix orphan account chapter subscription emails AO3-5696 Disable orphan account user subscription emails May 2, 2026
Comment thread app/models/subscription.rb Outdated
# Emails should never contain hidden works or chapters of hidden works.
# Emails should never contain orphaned works or chapters.
# TODO: AO3-3620 & AO3-5696: Allow subscriptions to orphan_account to receive notifications.
# When fixed, remove the two orphan_account checks below (lines with User.orphan_account).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In Oct 2025, we changed the goal of AO3-3620: users will not be able to subscribe to orphan_account. You can remove the TODO comment for AO3-3620 & AO3-5696 completely.

Comment thread spec/models/subscription_spec.rb Outdated
Comment thread spec/models/subscription_spec.rb Outdated
@pmonfort
Copy link
Copy Markdown
Contributor Author

pmonfort commented May 6, 2026

@redsummernight Thanks for the review! I've made the updates, let me know if it looks good.

@pmonfort pmonfort requested a review from redsummernight May 6, 2026 03:57
Copy link
Copy Markdown
Member

@redsummernight redsummernight left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants