From 606023094590c5b64ba000a03c5977fa29f0b5bc Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Wed, 22 Jan 2025 11:32:43 -0500 Subject: [PATCH] comments --- proto/device_sync/consent_backup.proto | 3 +++ proto/device_sync/device_sync.proto | 4 ++++ proto/device_sync/group_backup.proto | 3 +++ proto/device_sync/message_backup.proto | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/proto/device_sync/consent_backup.proto b/proto/device_sync/consent_backup.proto index 1c66834..c2824b0 100644 --- a/proto/device_sync/consent_backup.proto +++ b/proto/device_sync/consent_backup.proto @@ -1,18 +1,21 @@ syntax = "proto3"; package xmtp.device_sync.consent_backup; +// Proto representation of a consent record save message ConsentSave { ConsentTypeSave entity_type = 1; ConsentStateSave state = 2; string entity = 3; } +// Consent record type enum ConsentTypeSave { CONSENT_TYPE_SAVE_CONVERSATION_ID = 0; CONSENT_TYPE_SAVE_INBOX_ID = 1; CONSENT_TYPE_SAVE_ADDRESS = 2; } +// Consent record state enum ConsentStateSave { CONSENT_STATE_SAVE_UNKNOWN = 0; CONSENT_STATE_SAVE_ALLOWED = 1; diff --git a/proto/device_sync/device_sync.proto b/proto/device_sync/device_sync.proto index c0b8e27..892c4d2 100644 --- a/proto/device_sync/device_sync.proto +++ b/proto/device_sync/device_sync.proto @@ -5,6 +5,7 @@ import "device_sync/group_backup.proto"; import "device_sync/message_backup.proto"; import "device_sync/consent_backup.proto"; +// Union type representing everything that can be serialied and saved in a backup archive. message BackupElement { oneof element { BackupMetadataSave metadata = 1; @@ -14,6 +15,8 @@ message BackupElement { } } +// Proto representation of backup metadata +// (Backup version is explicitly missing - it's stored as a header.) message BackupMetadataSave { repeated BackupElementSelection elements = 2; int64 exported_at_ns = 3; @@ -21,6 +24,7 @@ message BackupMetadataSave { optional int64 end_ns = 5; } +// Elements selected for backup enum BackupElementSelection { BACKUP_ELEMENT_SELECTION_MESSAGES = 0; BACKUP_ELEMENT_SELECTION_CONSENT = 1; diff --git a/proto/device_sync/group_backup.proto b/proto/device_sync/group_backup.proto index 609f999..83efe41 100644 --- a/proto/device_sync/group_backup.proto +++ b/proto/device_sync/group_backup.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package xmtp.device_sync.group_backup; +// Proto representation of a stored group message GroupSave { bytes id = 1; int64 created_at_ns = 2; @@ -14,12 +15,14 @@ message GroupSave { optional int64 last_message_ns = 10; } +// Group membership state enum GroupMembershipStateSave { GROUP_MEMBERSHIP_STATE_SAVE_ALLOWED = 0; GROUP_MEMBERSHIP_STATE_SAVE_REJECTED = 1; GROUP_MEMBERSHIP_STATE_SAVE_PENDING = 2; } +// Conversation type enum ConversationTypeSave { CONVERSATION_TYPE_SAVE_GROUP = 0; CONVERSATION_TYPE_SAVE_DM = 1; diff --git a/proto/device_sync/message_backup.proto b/proto/device_sync/message_backup.proto index 8d14067..6d290dd 100644 --- a/proto/device_sync/message_backup.proto +++ b/proto/device_sync/message_backup.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package xmtp.device_sync.message_backup; +// Proto representation of a stored group message message GroupMessageSave { bytes id = 1; bytes group_id = 2; @@ -17,17 +18,20 @@ message GroupMessageSave { optional bytes reference_id = 13; } +// Group message kind enum GroupMessageKindSave { GROUP_MESSAGE_KIND_SAVE_APPLICATION = 0; GROUP_MESSAGE_KIND_SAVE_MEMBERSHIP_CHANGE = 1; } +// Group message delivery status enum DeliveryStatusSave { DELIVERY_STATUS_SAVE_UNPUBLISHED = 0; DELIVERY_STATUS_SAVE_PUBLISHED = 1; DELIVERY_STATUS_SAVE_FAILED = 2; } +// Group message content type enum ContentTypeSave { CONTENT_TYPE_SAVE_UNKNOWN = 0; CONTENT_TYPE_SAVE_TEXT = 1;