When leaving a bot running with an open event stream, I eventually (after a few days) get an event with "type": "shutdown" and "alertType":"default". This causes a JSON decoding error to be returned from WebexEventStream::next.
Here's an example of such a case:
{
"id": "a39cdd93-e1bb-4361-a59f-449010--omitted--",
"type": "shutdown",
"timestamp": 0,
"trackingId": "NA_4b40e577-3b56-4faa-ba5c-e4d1--omitted--",
"alertType": "default",
"sequenceNumber": 45,
"filterMessage": false,
"wsWriteTimestamp": 1769278479644
}
My guess is that it would be sufficient to add another variant to the AlertType enum.
|
pub enum AlertType { |
|
/// This event won't ever generate an alert (?) |
|
#[default] |
|
None, |
|
/// This event will always generate an alert (?) |
|
Full, |
|
/// okay, no idea... |
|
Visual, |
|
} |
I don't know if that type field should be included (optional I suppose) so that a shutdown can be detected and an appropriate error returned. I don't have much experience with the event stream, I've only used it through the webex crate, and I can't find it's documentation on developer.webex.com, but maybe I'm just looking in the wrong place.
I'd be happy to submit a fix if I could get a bit of guidance on what the right fix is in this case.
When leaving a bot running with an open event stream, I eventually (after a few days) get an event with
"type": "shutdown"and"alertType":"default". This causes a JSON decoding error to be returned fromWebexEventStream::next.Here's an example of such a case:
{ "id": "a39cdd93-e1bb-4361-a59f-449010--omitted--", "type": "shutdown", "timestamp": 0, "trackingId": "NA_4b40e577-3b56-4faa-ba5c-e4d1--omitted--", "alertType": "default", "sequenceNumber": 45, "filterMessage": false, "wsWriteTimestamp": 1769278479644 }My guess is that it would be sufficient to add another variant to the
AlertTypeenum.webex-rust/src/types.rs
Lines 1022 to 1030 in f132301
I don't know if that
typefield should be included (optional I suppose) so that a shutdown can be detected and an appropriate error returned. I don't have much experience with the event stream, I've only used it through thewebexcrate, and I can't find it's documentation on developer.webex.com, but maybe I'm just looking in the wrong place.I'd be happy to submit a fix if I could get a bit of guidance on what the right fix is in this case.