Introduce a deprecation reminder service#459
Open
jeffhwang-sq wants to merge 4 commits intomasterfrom
Open
Conversation
ce46279 to
d7ca889
Compare
mpawliszyn
reviewed
May 20, 2025
| @@ -0,0 +1,13 @@ | |||
| CREATE TABLE deprecation_reminders ( | |||
| id bigint(20) NOT NULL AUTO_INCREMENT, | |||
| registered_backfill_id bigint(20) NOT NULL, | |||
Collaborator
There was a problem hiding this comment.
Just add a last_messaged_on to registered_backfill
mpawliszyn
reviewed
May 20, 2025
| */ | ||
| @Singleton | ||
| class DeprecationNotificationService @Inject constructor( | ||
| private val notificationHelper: DeprecationNotificationHelper, |
Collaborator
There was a problem hiding this comment.
Two steps to sending a reminders.
-
Figure out registered backfills should have reminders sent this hour.
-
Determine if a reminder should go out for each backfill.
-
look at the registered backfill
- has a backfill run - pick the most recent run (run with the latest updated_at) look for the latest customer event and pick that time
- no backfill run - pick registration time (approximate deploy time so this should be a good time in the day)
- Now that you have a time and day of the week. Are we in that window?
- Make a call to the thing that is in cash-server whether to message now or not. Call will have a bunch of data:
- data structure around the last backfill run
-
- last user to touch the backfill
-
- the last status change (Complete, Fail, Paused) & time that happened
- Delete By date
- Backfill creation time
Return nothing or a message to send.
Collaborator
There was a problem hiding this comment.
ReminderMessagingDecider
Collaborator
There was a problem hiding this comment.
Always return false. If nothing is set do this? (Although maybe we make people pick.)
Remind monthly if there is a latest backfill or after 3 months if creation only.
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.
Effective Delete-by Date Calculation
Takes the latest of:
Service Activity Check
Notification Frequency
Business Hours
The config comes from cash-server side - https://github.com/squareup/cash-server/pull/18643
WIP - test