Skip to content

feat: Create EmptyWikibaseNotification Model and Notification#656

Merged
tarrow merged 43 commits into
mainfrom
empty_wiki_noti
Nov 17, 2023
Merged

feat: Create EmptyWikibaseNotification Model and Notification#656
tarrow merged 43 commits into
mainfrom
empty_wiki_noti

Conversation

@dati18
Copy link
Copy Markdown
Contributor

@dati18 dati18 commented Oct 10, 2023

Comment thread app/EmptyWikibaseNotification.php Outdated
Comment thread app/Console/Kernel.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Wiki.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Notifications/EmptyWikibaseNotification.php
Comment thread tests/Jobs/SendEmptyWikibaseNotificationsJobTest.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread tests/Jobs/SendEmptyWikibaseNotificationsJobTest.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Wiki.php Outdated
Comment thread app/Wiki.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Comment thread app/Jobs/SendEmptyWikibaseNotificationsJob.php Outdated
Copy link
Copy Markdown
Contributor

@m90 m90 left a comment

Choose a reason for hiding this comment

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

Looks great now, I left one last round of comments, nothing major.

Comment thread app/Jobs/SendEmptyWikiNotificationsJob.php
$wikiManagers = $wiki->wikiManagers()->get();

foreach($wikiManagers as $wikiManager) {
$wiki->wikiNotificationSentRecords()->create([
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Like this, we'd also create a record when the notfiy call below fails immediately. Should we create the record after calling notify?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's a great point but I'm not sure if that is the case since the notify method appears to dispatch the sending, but I'm not entirely sure how it all works in detail. My thinking was the other way around: prevent a case where we send a notification but don't keep a record, resulting in potentially spamming a user. But now I'm not sure how to prevent both cases

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, if notify will only ever fail asynchronously, then your argument is valid and it should be kept in the order you put it here. Maybe it's worth a comment though?

Comment thread app/Notifications/EmptyWikiNotification.php
Comment thread app/Wiki.php Outdated
Comment thread config/wbstack.php Outdated
Comment thread tests/Jobs/SendEmptyWikiNotificationsJobTest.php Outdated
Comment thread app/Jobs/SendEmptyWikiNotificationsJob.php
Copy link
Copy Markdown
Contributor

@m90 m90 left a comment

Choose a reason for hiding this comment

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

LGTM 🦖

Do you still want to add the CHANGELOG entry to this PR so we can ship it when merged?

@tarrow tarrow merged commit 809f5c3 into main Nov 17, 2023
@tarrow tarrow deleted the empty_wiki_noti branch November 17, 2023 11:10
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.

4 participants