Skip to content

Missing default alert type #63

@hds

Description

@hds

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.

webex-rust/src/types.rs

Lines 1022 to 1030 in f132301

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions