Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/326 overflow #327

Merged
merged 6 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion autoendpoint/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ impl ApiErrorKind {
| ApiErrorKind::InvalidAuthentication
| ApiErrorKind::InvalidLocalAuth(_) |
// Ignore missing or invalid user errors
ApiErrorKind::NoUser | ApiErrorKind::NoSubscription,
ApiErrorKind::NoUser | ApiErrorKind::NoSubscription |
// Ignore overflow errors
ApiErrorKind::Router(RouterError::TooMuchData(_)),
)
}

Expand Down
2 changes: 1 addition & 1 deletion autoendpoint/src/extractors/routers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::str::FromStr;
use std::sync::Arc;

/// Valid `DynamoDbUser::router_type` values
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[allow(clippy::upper_case_acronyms)]
pub enum RouterType {
WebPush,
Expand Down
6 changes: 3 additions & 3 deletions autoendpoint/src/headers/vapid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use thiserror::Error;
pub const ALLOWED_SCHEMES: [&str; 3] = ["bearer", "webpush", "vapid"];

/// Parses the VAPID authorization header
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct VapidHeader {
pub scheme: String,
pub token: String,
Expand All @@ -21,7 +21,7 @@ pub struct VapidHeaderWithKey {
}

/// Version-specific VAPID data. Also used to identify the VAPID version.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum VapidVersionData {
Version1,
Version2 { public_key: String },
Expand Down Expand Up @@ -77,7 +77,7 @@ impl VapidHeader {
}
}

#[derive(Debug, Error, PartialEq)]
#[derive(Debug, Error, Eq, PartialEq)]
pub enum VapidError {
#[error("Missing VAPID token")]
MissingToken,
Expand Down
1 change: 1 addition & 0 deletions autoendpoint/src/routers/apns/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ mod tests {
const DEVICE_TOKEN: &str = "test-token";
const APNS_ID: &str = "deadbeef-4f5e-4403-be8f-35d0251655f5";

#[allow(clippy::type_complexity)]
/// A mock APNS client which allows one to supply a custom APNS response/error
struct MockApnsClient {
send_fn: Box<dyn Fn(Payload<'_>) -> Result<a2::Response, a2::Error> + Send + Sync>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should make this a discrete type, but we only do this once, and I don't think it kills readability.

Expand Down
2 changes: 1 addition & 1 deletion autoendpoint/src/routers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub trait Router {
}

/// The response returned when a router routes a notification
#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, PartialEq)]
pub struct RouterResponse {
pub status: StatusCode,
pub headers: HashMap<&'static str, String>,
Expand Down
2 changes: 1 addition & 1 deletion autopush-common/src/db/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl From<HashMap<String, String>> for NotificationHeaders {
}
}

#[derive(Deserialize, PartialEq, Debug, Clone, Serialize)]
#[derive(Deserialize, Eq, PartialEq, Debug, Clone, Serialize)]
pub struct DynamoDbUser {
// DynamoDB <Hash key>
#[serde(serialize_with = "uuid_serializer")]
Expand Down
2 changes: 1 addition & 1 deletion autopush/src/megaphone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct BroadcastRevision {

// A provided Broadcast/Version used for `BroadcastSubsInit`, client comparisons, and outgoing
// deltas
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Broadcast {
broadcast_id: String,
version: String,
Expand Down