forked from jmug/stoatchat
refactor: capture errors with line numbers
refactor: update file api
This commit is contained in:
@@ -20,6 +20,7 @@ use crate::Database;
|
||||
|
||||
/// Payload information, before assembly
|
||||
#[derive(Debug)]
|
||||
#[allow(non_snake_case)]
|
||||
pub struct ApnPayload {
|
||||
message: Message,
|
||||
url: String,
|
||||
@@ -29,6 +30,7 @@ pub struct ApnPayload {
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
#[allow(non_snake_case)]
|
||||
struct Payload<'a> {
|
||||
aps: APS<'a>,
|
||||
#[serde(skip_serializing)]
|
||||
|
||||
@@ -11,7 +11,7 @@ use base64::{
|
||||
use deadqueue::limited::Queue;
|
||||
use fcm_v1::auth::{Authenticator, ServiceAccountKey};
|
||||
use once_cell::sync::Lazy;
|
||||
use revolt_config::config;
|
||||
use revolt_config::{config, report_internal_error};
|
||||
use revolt_models::v0::PushNotification;
|
||||
use revolt_presence::filter_online;
|
||||
use serde_json::json;
|
||||
@@ -116,12 +116,11 @@ pub async fn worker(db: Database, authifier_db: AuthifierDatabase) {
|
||||
if fcm_error.contains("404 (Not Found)") {
|
||||
println!("Unregistering {:?}", session.id);
|
||||
|
||||
if let Err(err) = db
|
||||
.remove_push_subscription_by_session_id(&session.id)
|
||||
.await
|
||||
{
|
||||
revolt_config::capture_error(&err);
|
||||
}
|
||||
report_internal_error!(
|
||||
db.remove_push_subscription_by_session_id(&session.id)
|
||||
.await
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user