fix: remaining push notification unwrap in second code path
- Fix second copy of push_subscription unwrap that was in a tokio::spawn block with different indentation - Replace constant UUID parse unwrap with expect()
This commit is contained in:
parent
68b70330b8
commit
df42af2ed0
@ -59,7 +59,8 @@ pub async fn process_message_ai_streaming(
|
||||
|
||||
tokio::spawn(async move {
|
||||
let _lock_guard = lock_guard;
|
||||
let ai_typing_id = Uuid::parse_str("00000000-0000-0000-0000-000000000001").unwrap();
|
||||
let ai_typing_id = Uuid::parse_str("00000000-0000-0000-0000-000000000001")
|
||||
.expect("constant UUID should always parse");
|
||||
let ai_display_name_for_chunk = ai_display_name.clone();
|
||||
let ai_display_name_for_final = ai_display_name.clone();
|
||||
|
||||
|
||||
@ -235,15 +235,11 @@ impl AppService {
|
||||
|
||||
if let Ok(Some(prefs)) = prefs {
|
||||
if prefs.push_enabled
|
||||
&& prefs.push_subscription_endpoint.is_some()
|
||||
&& prefs.push_subscription_keys_p256dh.is_some()
|
||||
&& prefs.push_subscription_keys_auth.is_some()
|
||||
&& let Some(endpoint) = &prefs.push_subscription_endpoint
|
||||
&& let Some(p256dh) = &prefs.push_subscription_keys_p256dh
|
||||
&& let Some(auth) = &prefs.push_subscription_keys_auth
|
||||
{
|
||||
let endpoint = prefs.push_subscription_endpoint.unwrap();
|
||||
let p256dh = prefs.push_subscription_keys_p256dh.unwrap();
|
||||
let auth = prefs.push_subscription_keys_auth.unwrap();
|
||||
|
||||
if let Err(e) = push.send(&endpoint, &p256dh, &auth, &payload).await {
|
||||
if let Err(e) = push.send(endpoint, p256dh, auth, &payload).await {
|
||||
tracing::warn!(user_id = %user_id, error = %e, "WebPush send failed");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user