prosody 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50b24e61e2dffddd6de734d1f7d46bbcd2cdc5351ff4205f09d1ed038a289a22
4
- data.tar.gz: c7d7b1533053dd7a30a7d370216f29202e4ff45eb137244de556eb1037398785
3
+ metadata.gz: 860e51b041d404b7b12b4cd15fd7bd7b29c96b1c45fe7b302d6300ab534a6995
4
+ data.tar.gz: afa8af17fdb47106755a92b1fb577f207e2c4775dcab673e6e4e0c88c5203c30
5
5
  SHA512:
6
- metadata.gz: 0b9478cb2ea9568f9a498b109638fa504d42a5ba802cdc3dc824d4495871c6670f6325593a10ec3a74075ae2616a1a6df292f45f7694575267bfa21da051af30
7
- data.tar.gz: 3563ae9225b5ab4373240e739ae950eabe7fbc5353d0de76fec05b954335fcb18892af74581e238543e5071d0eef10ae5932d0aaed37f0dc71f7c7926740e82f
6
+ metadata.gz: a80186ed25d2dfddcc6693ac7e8e4d27dca16d99dfa40462f3188012803f8b07cfbadaece2dc9b65c8a66bb8794111d5720eaf8b280b55ece0b460719b8352e2
7
+ data.tar.gz: 81f46464005e4aaa87e0a3f5712e8a988f850eaa72380864b30e87b334011727c98da847f78abc73d25f83556f51aac1429d456ad30a7aa37dd6eea247b356ec
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.1.2"
2
+ ".": "0.1.3"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.3](https://github.com/prosody-events/prosody-rb/compare/prosody/v0.1.2...prosody/v0.1.3) (2026-04-21)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **tracing:** set error status on on_message and on_timer spans ([#14](https://github.com/prosody-events/prosody-rb/issues/14)) ([849c021](https://github.com/prosody-events/prosody-rb/commit/849c0212b88d1069fc728ab38e9e05d79408c093))
9
+
3
10
  ## [0.1.2](https://github.com/prosody-events/prosody-rb/compare/prosody/v0.1.1...prosody/v0.1.2) (2026-04-20)
4
11
 
5
12
 
@@ -26,8 +26,8 @@ impl AsyncCallback {
26
26
  /// # Arguments
27
27
  ///
28
28
  /// * `queue` - A Ruby Queue object that will receive values from Rust
29
- /// * `bridge` - The bridge used to defer cleanup of the wrapped queue
30
- /// value onto the Ruby thread when the callback is dropped
29
+ /// * `bridge` - The bridge used to defer cleanup of the wrapped queue value
30
+ /// onto the Ruby thread when the callback is dropped
31
31
  pub fn from_queue(queue: Value, bridge: Bridge) -> Self {
32
32
  Self {
33
33
  queue: ThreadSafeValue::new(queue, bridge),
@@ -175,7 +175,8 @@ pub struct NativeConfiguration {
175
175
  /// Cache size for defer middleware.
176
176
  defer_cache_size: Option<u32>,
177
177
 
178
- /// Maximum number of deferred store entries kept in the write-through cache per Cassandra defer store.
178
+ /// Maximum number of deferred store entries kept in the write-through cache
179
+ /// per Cassandra defer store.
179
180
  defer_store_cache_size: Option<u32>,
180
181
 
181
182
  /// Timeout for Kafka seek operations (in seconds).
@@ -21,6 +21,7 @@ use futures::pin_mut;
21
21
  use magnus::value::ReprValue;
22
22
  use magnus::{Error, Ruby, Value};
23
23
  use opentelemetry::propagation::TextMapCompositePropagator;
24
+ use opentelemetry::trace::Status;
24
25
  use prosody::consumer::event_context::EventContext;
25
26
  use prosody::consumer::message::ConsumerMessage;
26
27
  use prosody::consumer::middleware::FallibleHandler;
@@ -33,6 +34,7 @@ use std::sync::Arc;
33
34
  use thiserror::Error;
34
35
  use tokio::select;
35
36
  use tracing::{Instrument, info_span};
37
+ use tracing_opentelemetry::OpenTelemetrySpanExt;
36
38
 
37
39
  mod context;
38
40
  mod message;
@@ -179,11 +181,13 @@ impl FallibleHandler for RubyHandler {
179
181
  // Wait for either task completion or shutdown signal
180
182
  select! {
181
183
  result = &mut result_future => {
182
- result?;
184
+ result.inspect_err(|e| cloned_span.set_status(Status::error(e.to_string())))?;
183
185
  }
184
186
  () = cancel_future => {
185
- // If cancellation requested, cancel the task and wait for it to complete
186
- task_handle.cancellation_token.cancel(&self.bridge).await?;
187
+ // A cancel() failure is a genuine bridge error; mark the span.
188
+ // The subsequent result_future error is expected cancellation, not a handler bug.
189
+ task_handle.cancellation_token.cancel(&self.bridge).await
190
+ .inspect_err(|e| cloned_span.set_status(Status::error(e.to_string())))?;
187
191
  result_future.await?;
188
192
  }
189
193
  }
@@ -262,11 +266,13 @@ impl FallibleHandler for RubyHandler {
262
266
  // Wait for either task completion or shutdown signal
263
267
  select! {
264
268
  result = &mut result_future => {
265
- result?;
269
+ result.inspect_err(|e| cloned_span.set_status(Status::error(e.to_string())))?;
266
270
  }
267
271
  () = cancel_future => {
268
- // If cancellation requested, cancel the task and wait for it to complete
269
- task_handle.cancellation_token.cancel(&self.bridge).await?;
272
+ // A cancel() failure is a genuine bridge error; mark the span.
273
+ // The subsequent result_future error is expected cancellation, not a handler bug.
274
+ task_handle.cancellation_token.cancel(&self.bridge).await
275
+ .inspect_err(|e| cloned_span.set_status(Status::error(e.to_string())))?;
270
276
  result_future.await?;
271
277
  }
272
278
  }
@@ -26,8 +26,8 @@ impl CancellationToken {
26
26
  /// # Arguments
27
27
  ///
28
28
  /// * `token` - A Ruby value that responds to the `cancel` method
29
- /// * `bridge` - The bridge used to defer cleanup of the wrapped token
30
- /// value onto the Ruby thread when the token is dropped
29
+ /// * `bridge` - The bridge used to defer cleanup of the wrapped token value
30
+ /// onto the Ruby thread when the token is dropped
31
31
  pub fn new(token: Value, bridge: Bridge) -> Self {
32
32
  Self {
33
33
  token: ThreadSafeValue::new(token, bridge),
@@ -6,5 +6,5 @@ module Prosody
6
6
  # This version number follows semantic versioning and is used by the
7
7
  # gem system to identify the library version. It should be updated
8
8
  # according to semver guidelines when making releases.
9
- VERSION = "0.1.2"
9
+ VERSION = "0.1.3"
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prosody
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Griffith