2121from services .comparison import ComparisonProxy
2222from services .decoration import Decoration
2323from services .license import is_properly_licensed
24- from services .notification .commit_notifications import store_notification_results
24+ from services .notification .commit_notifications import (
25+ create_or_update_commit_notification_from_notification_result ,
26+ )
2527from services .notification .notifiers import (
2628 StatusType ,
2729 get_all_notifier_classes_mapping ,
@@ -305,8 +307,6 @@ def notify(self, comparison: ComparisonProxy) -> list[IndividualResult]:
305307 for notifier in all_other_notifiers
306308 )
307309
308- store_notification_results (comparison , results )
309-
310310 return [
311311 IndividualResult (
312312 notifier = notifier .name , title = notifier .title , result = result
@@ -333,6 +333,7 @@ def notify_individual_notifier(
333333 }
334334
335335 log .info ("Attempting individual notification" , extra = log_extra )
336+ res : NotificationResult | None = None
336337 try :
337338 res = notifier .notify (
338339 comparison , status_or_checks_helper_text = status_or_checks_helper_text
@@ -349,7 +350,14 @@ def notify_individual_notifier(
349350 raise
350351 except Exception :
351352 log .exception ("Individual notifier failed" , extra = log_extra )
352- return notifier , None
353+ return notifier , res
354+ finally :
355+ if res is None or res .notification_attempted :
356+ # only running if there is no result (indicating some exception)
357+ # or there was an actual attempt
358+ create_or_update_commit_notification_from_notification_result (
359+ comparison , notifier , res
360+ )
353361
354362
355363def split_notifiers (
0 commit comments