xmtp_common/
event_logging.rs

1mod utils;
2pub use utils::*;
3
4#[xmtp_macro::build_logging_metadata]
5pub enum Event {
6    // ===================== General Client =====================
7    /// Client created
8    #[context(device_sync_enabled, disabled_workers, inbox_id, full_installation_id)]
9    ClientCreated,
10
11    // ===================== Group Operations =====================
12    /// DM created.
13    #[context(group_id, target_inbox_id)]
14    CreatedDM,
15    /// Group created.
16    #[context(group_id)]
17    CreatedGroup,
18    /// Added members to group.
19    #[context(group_id, members)]
20    AddedMembers,
21    /// Received new group from welcome.
22    #[context(group_id, conversation_type)]
23    ProcessedWelcome,
24
25    // ===================== MLS Operations =====================
26    /// Received staged commit. Merging and clearing any pending commits.
27    #[context(group_id, inbox_id, sender_inbox_id, msg_epoch, current_epoch)]
28    MLSReceivedStagedCommit,
29    /// Processed staged commit.
30    #[context(group_id, current_epoch)]
31    MLSProcessedStagedCommit,
32    /// Received application message.
33    #[context(group_id, current_epoch, msg_epoch, sender_inbox_id)]
34    MLSReceivedApplicationMessage,
35    /// Processed application message.
36    #[context(group_id)]
37    MLSProcessedApplicationMessage,
38    /// Group epoch updated.
39    #[context(group_id, cursor, epoch, previous_epoch)]
40    MLSGroupEpochUpdated,
41
42    // ===================== Group Syncing =====================
43    /// Begin syncing group.
44    #[context(group_id)]
45    GroupSyncStart,
46    /// Attempting to sync group.
47    #[context(group_id, attempt, backoff)]
48    GroupSyncAttempt,
49    /// Group sync complete.
50    #[context(group_id, summary, success)]
51    GroupSyncFinished,
52    /// Attempted to sync on an inactive group.
53    #[context(group_id)]
54    GroupSyncGroupInactive,
55    /// Intent failed to sync but did not error. This can happen for a variety of reasons.
56    #[context(group_id, intent_id, intent_kind, state)]
57    GroupSyncIntentRetry,
58    /// Intent was found to be in error after attempting to sync.
59    #[context(group_id, intent_id, intent_kind, summary)]
60    GroupSyncIntentErrored,
61    /// Attempt to publish intent failed.
62    #[context(group_id, intent_id, intent_kind, err)]
63    GroupSyncPublishFailed,
64    /// Application message published successfully.
65    #[context(group_id, intent_id)]
66    GroupSyncApplicationMessagePublishSuccess,
67    /// Commit published successfully.
68    #[context(group_id, intent_id, intent_kind, commit_hash)]
69    GroupSyncCommitPublishSuccess,
70    /// Commit sent. Staged commit is present. Stopping further publishes for this round.
71    #[context(group_id)]
72    GroupSyncStagedCommitPresent,
73    /// Updating group cursor.
74    #[context(group_id, cursor)]
75    GroupCursorUpdate,
76
77    // ===================== Group Membership =====================
78    /// Updating group membership. Calculating which installations need to be added / removed.
79    #[context(group_id, old_membership, new_membership)]
80    MembershipInstallationDiff,
81    /// Result: The following installations need to be added / removed.
82    #[context(group_id, added_installations, removed_installations)]
83    MembershipInstallationDiffComputed,
84
85    // ===================== Device Sync =====================
86    /// Device Sync worker initializing.
87    #[context(server_url)]
88    DeviceSyncInitializing,
89    /// Device sync initialized.
90    DeviceSyncInitializingFinished,
91    /// No primary sync group found.
92    DeviceSyncNoPrimarySyncGroup,
93    /// Created primary sync group.
94    #[context(group_id)]
95    DeviceSyncCreatedPrimarySyncGroup,
96    /// Sent a sync request.
97    #[context(group_id)]
98    DeviceSyncSentSyncRequest,
99    /// Processing new sync message.
100    #[context(msg_type, external, msg_id, group_id)]
101    DeviceSyncProcessingMessages,
102    /// Failed to process device sync message.
103    #[context(msg_id, err)]
104    DeviceSyncMessageProcessingError,
105    /// Processing sync archive.
106    #[context(msg_id, group_id)]
107    DeviceSyncArchiveProcessingStart,
108    /// Received a V1 sync payload. V1 is no longer supported. Ignoring.
109    DeviceSyncV1Archive,
110    /// Received a sync archive message, but it was not requested by this instalaltion. Skipping.
111    DeviceSyncArchiveNotRequested,
112    /// Downloading sync archive.
113    DeviceSyncArchiveDownloading,
114    /// Sync archive download failure.
115    #[context(status, err)]
116    DeviceSyncPayloadDownloadFailure,
117    /// Beginning archive import.
118    DeviceSyncArchiveImportStart,
119    /// Finished sync archive import.
120    DeviceSyncArchiveImportSuccess,
121    /// Archive import failed.
122    #[context(err)]
123    DeviceSyncArchiveImportFailure,
124    /// Attempted to acknowledge a sync request, but it was already acknowledged
125    /// by another installation.
126    #[context(request_id, acknowledged_by)]
127    DeviceSyncRequestAlreadyAcknowledged,
128    /// Acknowledged sync request.
129    #[context(request_id)]
130    DeviceSyncRequestAcknowledged,
131    /// Scheduled task to respond to sync request.
132    #[context(request_id)]
133    DeviceSyncResponseTaskScheduled,
134    /// Sending sync archive
135    #[context(group_id, server_url)]
136    DeviceSyncArchiveUploadStart,
137    /// Failed to respond to sync request.
138    #[context(group_id, request_id, err)]
139    DeviceSyncArchiveUploadFailure,
140    /// Cannot send sync archive. No server_url present.
141    #[context(request_id)]
142    DeviceSyncNoServerUrl,
143}