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, |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 37 | /// the last fill stopped short of joining, and another one carries on from there |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 38 | Paused { |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 39 | reason: HistoryGapPause, |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 40 | }, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 41 | Failed, |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 42 | /// accessible history ends before the older section, so this interval stays |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 43 | Unavailable, |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 44 | } |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 45 | |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 46 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 47 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 48 | pub enum HistoryGapPause { |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 49 | CursorStalled, |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 50 | Budget, |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 51 | } |
417da9e719bc | atagen | 2026-10-26 02:40 UTC | 52 | |
c9f0fd0ee1cc | atagen | 2026-10-25 06:16 UTC | 53 | #[derive(Clone, Debug, PartialEq, Eq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 54 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 55 | pub enum HistoryContinuity { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 56 | Unresolved, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 57 | Verified, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 58 | AccessibleStart, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 59 | } |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 60 | |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 61 | #[derive(Clone, Debug, PartialEq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 62 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 63 | pub enum HistoryRepairPhase { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 64 | Bridging, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 65 | Ready, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 66 | Paused, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 67 | } |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 68 | |
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 enum HistoryRepairStop { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 72 | Cancelled, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 73 | Budget, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 74 | HistoryUnavailable, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 75 | CursorStalled, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 76 | } |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 77 | |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 78 | /// one gap fill. `Bridging` when it starts, then once more when it settles |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 79 | #[derive(Clone, Debug, PartialEq)] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 80 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 81 | pub struct HistoryRepairReport { |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 82 | pub room_id: OwnedRoomId, |
d9b96952ec60 | atagen | 2026-10-25 09:07 UTC | 83 | pub gap_id: OwnedTransactionId, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 84 | pub pages: u32, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 85 | pub events: u32, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 86 | pub phase: HistoryRepairPhase, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 87 | pub continuity: HistoryContinuity, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 88 | pub stop: Option<HistoryRepairStop>, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 89 | pub failure: Option<Error>, |
80381e06a573 | atagen | 2026-10-25 03:02 UTC | 90 | } |