mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
fix(push): restore iOS avatars and stop misrouting relay endpoints (#2932)
This commit is contained in:
1 parent
a0825e77c4
commit
425dab983b
6 files changed
+216
-17
No files matched your search
@@ -221,7 +221,6 @@ fn apns_dead_token(status: u16, reason: &str) -> Option<DeadToken> {
|
||||
(_, "Unregistered") => Some(DeadToken::Gone("unregistered")),
|
||||
(410, _) => Some(DeadToken::Gone("gone")),
|
||||
(400, "BadDeviceToken") => Some(DeadToken::Invalid("bad_device_token")),
|
||||
(400, "DeviceTokenNotForTopic") => Some(DeadToken::Invalid("device_token_not_for_topic")),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -308,6 +307,19 @@ mod tests {
|
||||
assert!(!error.without_url().to_string().contains(TOKEN));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_wrong_topic_is_not_a_dead_token() {
|
||||
assert_eq!(apns_dead_token(400, "DeviceTokenNotForTopic"), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_bad_device_token_is_still_a_dead_token() {
|
||||
assert_eq!(
|
||||
apns_dead_token(400, "BadDeviceToken"),
|
||||
Some(DeadToken::Invalid("bad_device_token"))
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn a_refused_connection_stays_retryable() {
|
||||
let error = error_for("http://127.0.0.1:1/").await;
|
||||
|
||||
Reference in new issue
Block a user