mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 15:06:30 +03:00
add status_update_serial to webxdc_status_update event (#3215)
this bypasses the replication safety introduced by letting the caller track the last serial, however, in case of bots that do not track much state and do not playback updates anyway, it is still useful.
This commit is contained in:
@@ -254,9 +254,14 @@ impl Context {
|
||||
)
|
||||
.await?;
|
||||
|
||||
self.emit_event(EventType::WebxdcStatusUpdate(instance.id));
|
||||
let status_update_serial = StatusUpdateSerial(u32::try_from(rowid)?);
|
||||
|
||||
Ok(StatusUpdateSerial(u32::try_from(rowid)?))
|
||||
self.emit_event(EventType::WebxdcStatusUpdate {
|
||||
msg_id: instance.id,
|
||||
status_update_serial,
|
||||
});
|
||||
|
||||
Ok(status_update_serial)
|
||||
}
|
||||
|
||||
/// Sends a status update for an webxdc instance.
|
||||
@@ -1016,7 +1021,10 @@ mod tests {
|
||||
.get_matching(|evt| matches!(evt, EventType::WebxdcStatusUpdate { .. }))
|
||||
.await;
|
||||
match event {
|
||||
EventType::WebxdcStatusUpdate(msg_id) => {
|
||||
EventType::WebxdcStatusUpdate {
|
||||
msg_id,
|
||||
status_update_serial: _,
|
||||
} => {
|
||||
assert_eq!(msg_id, instance_id);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
|
||||
Reference in New Issue
Block a user