Skip to content

AO3-6277 Make email and the Matching page reflect it when match generation results in no matches#5512

Open
slavalamp wants to merge 7 commits intootwcode:masterfrom
slavalamp:AO3-6277_no_matches_mailer_and_page
Open

AO3-6277 Make email and the Matching page reflect it when match generation results in no matches#5512
slavalamp wants to merge 7 commits intootwcode:masterfrom
slavalamp:AO3-6277_no_matches_mailer_and_page

Conversation

@slavalamp
Copy link
Contributor

@slavalamp slavalamp commented Dec 18, 2025

Pull Request Checklist

Issue

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

Purpose

When a gift exchange's match generation results in no matches, sends a "No potential matches found" email and makes the Matching page reflect the matching status appropriately too.

Also prepares some other Matching page states for localization, I got a bit carried away...

Credit

slavalamp (they/them)

@github-actions github-actions bot added Has Migrations Contains migrations and therefore needs special attention when deploying Awaiting Review labels Dec 18, 2025
@slavalamp slavalamp marked this pull request as ready for review December 24, 2025 03:21
@slavalamp
Copy link
Contributor Author

slavalamp commented Dec 24, 2025

I'm the procrastinator and forgot what else I wanted to do by now, so ready for review I guess. It might needs more tests?

I couldn't actually get the "No potential matches were found" page to show up locally consistently (sometimes it becomes "No potential matches yet!"), but the test succeeds every time I run it, so not sure if that's an issue with the code... though i also had web and tests actually behave differently earlier...

Also it resets the "no matches found" status and allows re-generating matches every time when any challenge settings get updated, even if they wouldn't have an effect on the ability to generate matches, bad idea or doesn't matter?

)
end

def no_potential_matches_notification(collection_id, email)
Copy link
Member

Choose a reason for hiding this comment

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

I think this make more sense in https://github.com/otwcode/otwarchive/blob/master/app/mailers/collection_mailer.rb (or even a new gift exchange mailer)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are a lot of challenge-related emails in user_mailer, should i move all other ones too then?

Copy link
Contributor

@Bilka2 Bilka2 Feb 3, 2026

Choose a reason for hiding this comment

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

the item added notification is emailed only to the collection email, never maintainers, so i'm not so sure if we should combine emails that can go to maintainers into collection_mailer

@@ -0,0 +1,5 @@
class AddNoPotentialMatchesFoundToGiftExchanges < ActiveRecord::Migration[7.2]
def change
add_column :gift_exchanges, :no_potential_matches_found, :boolean, default: false, null: false
Copy link
Member

Choose a reason for hiding this comment

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

Can't we just use this?

@collection.challenge.no_potential_matches_found?

I'm not sure why the extra database column is needed 🤔

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

Labels

Has Migrations Contains migrations and therefore needs special attention when deploying Reviewed: Action Needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants