Skip to content

feat: Add periodical job to clean outdated notifications#2897

Open
Koc wants to merge 1 commit intomasterfrom
feature/cleanup-outdated-notifications
Open

feat: Add periodical job to clean outdated notifications#2897
Koc wants to merge 1 commit intomasterfrom
feature/cleanup-outdated-notifications

Conversation

@Koc
Copy link
Copy Markdown

@Koc Koc commented Apr 7, 2026

In our organization we have too many notificatons and this slowdowns app, increase db size, etc.

This PR adds possibility to cleanup outdated notifications that met next criteria:

  • notification was created more than 35 days ago
  • user has more than 500 notifications

I can move this hardcoded criterias to the settings if needed.

@Koc Koc requested a review from nickvergessen as a code owner April 7, 2026 09:36
@Koc Koc force-pushed the feature/cleanup-outdated-notifications branch from 0eb8caa to 03d53d9 Compare April 7, 2026 09:41
@Koc Koc changed the title Add periodical job to cleanup outdated notifications feat: Add periodical job to clean outdated notifications Apr 7, 2026
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc Koc force-pushed the feature/cleanup-outdated-notifications branch from 03d53d9 to 94dca3c Compare April 7, 2026 09:43
@nickvergessen
Copy link
Copy Markdown
Member

  • Are you mostly having issues with activity notifications, or is it from other apps, ref Notification settings UX review #1741
  • For activity related notifications I'd accept the proposal.
  • For notifications from other apps, simply clearing all notifications with a 4-5 week (parental leave, etc.) is not acceptable.

Copy link
Copy Markdown
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

As mentioned at least the time constraint is not a good/acceptable one from my POV.

)
->setMaxResults(1000)
->executeQuery()
->fetchAll(\PDO::FETCH_COLUMN);
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.

This does not scale

continue;
}

$qb = $this->db->getQueryBuilder();
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.

Should construct once and then only set the parameters for each call,
but this here will also not scale on bigger instances. We can't really have a background job that runs a query per user.

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