Bug #21026

Notification not cleared when there is no other discovered host

Added by Sebastian Gräßl 2 months ago. Updated 25 days ago.

Status:Closed
Priority:Normal
Assigned To:Sebastian Gräßl
Category:Notifications
Target version:-
Difficulty: Bugzilla link:1488998
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4861
Story points-
Velocity based estimate-
Release1.17.0Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1488998

Description of problem:

No notification regarding Discovery Host should be visible when there is no one available (see screenshot).

How reproducible:

Always

Steps to Reproduce:
1. Create a Discovery Host
2. Delete the Discovery Host

Actual results:

There is a notifications regarding discovery host even in its absence.

Expected results:

No notifications regarding discovery host.

Associated revisions

Revision 6d6adc3a
Added by Sebastian Gräßl 25 days ago

Fixes #21026 - Clear cached notifications properly

Using `delete_all` for has_many does not trigger callbacks
on the associated objects, `dependent: :destroy` does.

Clearing the cache needs to happen anytime a notification
gets created, modified and destroyed, `after_commit`
will be triggered on all o these occasions.

History

#1 Updated by Sebastian Gräßl 2 months ago

  • Subject changed from Notification not cleared when there is not discovered host to Notification not cleared when there is not discovered host
  • Assigned To set to Sebastian Gräßl

#2 Updated by Sebastian Gräßl 2 months ago

  • Project changed from Discovery to Foreman
  • Subject changed from Notification not cleared when there is not discovered host to Notification not cleared when there is no other discovered host
  • Category set to Notifications

#3 Updated by The Foreman Bot 2 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4861 added

#4 Updated by Tomer Brisker 25 days ago

  • Release set to 1.17.0

#5 Updated by Ohad Levy 25 days ago

Tomer - I would suggest 1.16 instead - any concerns?

#6 Updated by Anonymous 25 days ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF