mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-03 13:53:21 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b09176163 | ||
|
|
aabdb5003c |
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
Errors while sending push notifications will now appear in the server log under more conditions, and will be registered as failures in Prometheus metrics.
|
||||||
@@ -1 +0,0 @@
|
|||||||
The `element_hacks` build feature, which has done almost nothing for many versions, has been removed completely. Contributed by @ginger.
|
|
||||||
@@ -102,7 +102,7 @@ look like this:
|
|||||||
RUSTFLAGS="--cfg tokio_unstable" cargo +nightly build \
|
RUSTFLAGS="--cfg tokio_unstable" cargo +nightly build \
|
||||||
--release \
|
--release \
|
||||||
--no-default-features \
|
--no-default-features \
|
||||||
--features=systemd,gzip_compression,brotli_compression,zstd_compression,tokio_console
|
--features=systemd,element_hacks,gzip_compression,brotli_compression,zstd_compression,tokio_console
|
||||||
```
|
```
|
||||||
|
|
||||||
You will also need to enable the `tokio_console` config option in Continuwuity
|
You will also need to enable the `tokio_console` config option in Continuwuity
|
||||||
|
|||||||
+1
-1
@@ -146,7 +146,7 @@ cargo clippy \
|
|||||||
--locked \
|
--locked \
|
||||||
--profile test \
|
--profile test \
|
||||||
--no-default-features \
|
--no-default-features \
|
||||||
--features=console,systemd,direct_tls,perf_measurements,brotli_compression \
|
--features=console,systemd,element_hacks,direct_tls,perf_measurements,brotli_compression \
|
||||||
--color=always \
|
--color=always \
|
||||||
-- \
|
-- \
|
||||||
-D warnings
|
-D warnings
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ brotli_compression = [
|
|||||||
"conduwuit-service/brotli_compression",
|
"conduwuit-service/brotli_compression",
|
||||||
"reqwest/brotli",
|
"reqwest/brotli",
|
||||||
]
|
]
|
||||||
|
element_hacks = [
|
||||||
|
"conduwuit-service/element_hacks",
|
||||||
|
]
|
||||||
gzip_compression = [
|
gzip_compression = [
|
||||||
"conduwuit-core/gzip_compression",
|
"conduwuit-core/gzip_compression",
|
||||||
"conduwuit-service/gzip_compression",
|
"conduwuit-service/gzip_compression",
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ default = [
|
|||||||
standard = [
|
standard = [
|
||||||
"brotli_compression",
|
"brotli_compression",
|
||||||
"direct_tls",
|
"direct_tls",
|
||||||
|
"element_hacks",
|
||||||
"gzip_compression",
|
"gzip_compression",
|
||||||
"io_uring",
|
"io_uring",
|
||||||
"jemalloc_conf",
|
"jemalloc_conf",
|
||||||
@@ -85,6 +86,10 @@ console = [
|
|||||||
direct_tls = [
|
direct_tls = [
|
||||||
"conduwuit-router/direct_tls"
|
"conduwuit-router/direct_tls"
|
||||||
]
|
]
|
||||||
|
element_hacks = [
|
||||||
|
"conduwuit-service/element_hacks",
|
||||||
|
"conduwuit-router/element_hacks",
|
||||||
|
]
|
||||||
gzip_compression = [
|
gzip_compression = [
|
||||||
"conduwuit-core/gzip_compression",
|
"conduwuit-core/gzip_compression",
|
||||||
"conduwuit-router/gzip_compression",
|
"conduwuit-router/gzip_compression",
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ direct_tls = [
|
|||||||
"axum-server/tls-rustls-no-provider",
|
"axum-server/tls-rustls-no-provider",
|
||||||
"dep:axum-server-dual-protocol",
|
"dep:axum-server-dual-protocol",
|
||||||
]
|
]
|
||||||
|
element_hacks = [
|
||||||
|
"conduwuit-api/element_hacks",
|
||||||
|
]
|
||||||
gzip_compression = [
|
gzip_compression = [
|
||||||
"conduwuit-admin/gzip_compression",
|
"conduwuit-admin/gzip_compression",
|
||||||
"conduwuit-api/gzip_compression",
|
"conduwuit-api/gzip_compression",
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ console = [
|
|||||||
"dep:rustyline-async",
|
"dep:rustyline-async",
|
||||||
"dep:termimad",
|
"dep:termimad",
|
||||||
]
|
]
|
||||||
|
element_hacks = []
|
||||||
gzip_compression = [
|
gzip_compression = [
|
||||||
"conduwuit-core/gzip_compression",
|
"conduwuit-core/gzip_compression",
|
||||||
"reqwest/gzip",
|
"reqwest/gzip",
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ impl Service {
|
|||||||
"lazy loading should be enabled by your options"
|
"lazy loading should be enabled by your options"
|
||||||
);
|
);
|
||||||
|
|
||||||
let include_redundant = ctx.options.is_some_and(Options::include_redundant_members);
|
let include_redundant = cfg!(feature = "element_hacks")
|
||||||
|
|| ctx.options.is_some_and(Options::include_redundant_members);
|
||||||
|
|
||||||
let witness = self
|
let witness = self
|
||||||
.witness(ctx, senders.iter().map(AsRef::as_ref))
|
.witness(ctx, senders.iter().map(AsRef::as_ref))
|
||||||
|
|||||||
@@ -970,6 +970,8 @@ impl Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut first_push_error = None;
|
||||||
|
|
||||||
for pdu in pdus {
|
for pdu in pdus {
|
||||||
// Redacted events are not notification targets (we don't send push
|
// Redacted events are not notification targets (we don't send push
|
||||||
// for them)
|
// for them)
|
||||||
@@ -995,15 +997,27 @@ impl Service {
|
|||||||
.try_into()
|
.try_into()
|
||||||
.expect("notification count can't go that high");
|
.expect("notification count can't go that high");
|
||||||
|
|
||||||
let _response = self
|
let response = self
|
||||||
.services
|
.services
|
||||||
.pusher
|
.pusher
|
||||||
.send_push_notice(&user_id, unread, &pusher, rules_for_user, &pdu)
|
.send_push_notice(&user_id, unread, &pusher, rules_for_user, &pdu)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| (Destination::Push(user_id.clone(), pushkey.clone()), e));
|
.map_err(|e| (Destination::Push(user_id.clone(), pushkey.clone()), Box::new(e)));
|
||||||
|
|
||||||
|
if let Err(err) = response {
|
||||||
|
error!(event = %pdu.event_id, pusher = %pusher.app_display_name, "Failed to deliver push notification: {err:?}");
|
||||||
|
|
||||||
|
if first_push_error.is_none() {
|
||||||
|
first_push_error = Some(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Destination::Push(user_id, pushkey))
|
if let Some(err) = first_push_error {
|
||||||
|
Err(err)
|
||||||
|
} else {
|
||||||
|
Ok(Destination::Push(user_id, pushkey))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn send_events_dest_federation(
|
async fn send_events_dest_federation(
|
||||||
|
|||||||
Reference in new issue
Block a user