c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 1 | use ruma::{OwnedEventId, OwnedRoomId, OwnedTransactionId}; |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 2 | |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 3 | #[cfg(feature = "serde")] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 4 | use serde::{Deserialize, Serialize}; |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 5 | |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 6 | use crate::Error; |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 7 | |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 8 | #[derive(Clone, Debug, PartialEq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 9 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 10 | #[non_exhaustive] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 11 | pub enum HistoryRepairCommand { |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 12 | /// runs the open-time recent load again, joining one already running. the outcome |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 13 | /// arrives as `RecentHistoryChanged` |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 14 | RetryRecent { room_id: OwnedRoomId }, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 15 | FillGap { |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 16 | room_id: OwnedRoomId, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 17 | gap_id: OwnedTransactionId, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 18 | }, |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 19 | /// stops whichever history operation the room is running |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 20 | Cancel { room_id: OwnedRoomId }, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 21 | } |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 22 | |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 23 | #[derive(Clone, Debug, PartialEq, Eq)] |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 24 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 25 | pub struct HistoryGap { |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 26 | pub id: OwnedTransactionId, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 27 | pub older_boundary: Option<OwnedEventId>, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 28 | pub newer_boundary: Option<OwnedEventId>, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 29 | pub lifecycle: HistoryGapLifecycle, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 30 | pub failure: Option<String>, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 31 | } |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 32 | |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 33 | #[derive(Clone, Debug, PartialEq, Eq)] |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 34 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 35 | pub enum HistoryGapLifecycle { |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 36 | Idle, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 37 | Paused, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 38 | Failed, |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 39 | /// accessible history ends before the older section, so this interval stays |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 40 | Unavailable, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 41 | } |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 42 | |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 43 | #[derive(Clone, Debug, PartialEq, Eq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 44 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 45 | pub enum HistoryContinuity { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 46 | Unresolved, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 47 | Verified, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 48 | AccessibleStart, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 49 | } |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 50 | |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 51 | #[derive(Clone, Debug, PartialEq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 52 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 53 | pub enum HistoryRepairPhase { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 54 | Bridging, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 55 | Ready, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 56 | Paused, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 57 | } |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 58 | |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 59 | #[derive(Clone, Debug, PartialEq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 60 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 61 | pub enum HistoryRepairStop { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 62 | Cancelled, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 63 | Budget, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 64 | HistoryUnavailable, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 65 | CursorStalled, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 66 | } |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 67 | |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 68 | /// one gap fill. `Bridging` when it starts, then once more when it settles |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 69 | #[derive(Clone, Debug, PartialEq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 70 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 71 | pub struct HistoryRepairReport { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 72 | pub room_id: OwnedRoomId, |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 73 | pub gap_id: OwnedTransactionId, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 74 | pub pages: u32, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 75 | pub events: u32, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 76 | pub phase: HistoryRepairPhase, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 77 | pub continuity: HistoryContinuity, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 78 | pub stop: Option<HistoryRepairStop>, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 79 | pub failure: Option<Error>, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 80 | } |