diff --git a/apps/labrinth/src/routes/internal/external_notifications.rs b/apps/labrinth/src/routes/internal/external_notifications.rs index a9609dd3d4..3381af196d 100644 --- a/apps/labrinth/src/routes/internal/external_notifications.rs +++ b/apps/labrinth/src/routes/internal/external_notifications.rs @@ -64,23 +64,33 @@ pub async fn create( .insert_many(user_ids, &mut txn, &redis) .await?; - txn.commit().await?; - - let notifications = DBNotification::get_many(¬ification_ids, &**pool) + let notifications = DBNotification::get_many(¬ification_ids, &mut txn) .await? .into_iter() .map(Notification::from) .collect::>(); + txn.commit().await?; + for notification in notifications { - broadcast_friends_message( + let notification_id = notification.id; + let to_user = notification.user_id; + if let Err(error) = broadcast_friends_message( &redis, RedisFriendsMessage::Notification { - to_user: notification.user_id, + to_user, notification, }, ) - .await?; + .await + { + tracing::warn!( + ?error, + ?notification_id, + ?to_user, + "failed to broadcast realtime notification" + ); + } } Ok(HttpResponse::Accepted().finish()) diff --git a/packages/ui/src/components/nav/PopupNotificationPanel.vue b/packages/ui/src/components/nav/PopupNotificationPanel.vue index 3b0b66038b..571ccef403 100644 --- a/packages/ui/src/components/nav/PopupNotificationPanel.vue +++ b/packages/ui/src/components/nav/PopupNotificationPanel.vue @@ -180,6 +180,7 @@ withDefaults( right: 1.5rem; z-index: 200; width: 520px; + max-width: calc(100vw - 3rem); display: flex; flex-direction: column; gap: 0.75rem; @@ -192,6 +193,7 @@ withDefaults( @media screen and (max-width: 500px) { .popup-notification-group { width: calc(100% - 1.5rem); + max-width: none; right: 0.75rem; } }