status-go/protocol/protobuf/application_metadata_message.proto
Andrea Maria Piana 605fe40e32 Fix encryption metadata issues #4613
This commit fixes a few issues with communities encryption:

Key distribution was disconnected from the community description, this created a case where the key would arrive after the community description and that would result in the client thinking that it was kicked.
To overcome this, we added a message that signals the user that is kicked. Also, we distribute the key with the community description so that there's no more issues with timing.
This is a bit expensive for large communities, and it will require some further optimizations.

Key distribution is now also connected to the request to join response, so there are no timing issues.

Fixes an issue with key distribution (race condition) where the community would be modified before being compared, resulting in a comparison of two identical communities, which would result in no key being distributed. This commit only partially address the issue.
2024-02-07 10:25:41 +00:00

104 lines
3.4 KiB
Protocol Buffer

syntax = "proto3";
option go_package = "./;protobuf";
package protobuf;
message ApplicationMetadataMessage {
// Signature of the payload field
bytes signature = 1;
// This is the encoded protobuf of the application level message, i.e ChatMessage
bytes payload = 2;
// The type of protobuf message sent
Type type = 3;
enum Type {
reserved 14;
reserved "SYNC_INSTALLATION_PUBLIC_CHAT";
UNKNOWN = 0;
CHAT_MESSAGE = 1;
CONTACT_UPDATE = 2;
MEMBERSHIP_UPDATE_MESSAGE = 3;
SYNC_PAIR_INSTALLATION = 4;
DEPRECATED_SYNC_INSTALLATION = 5 [deprecated=true];
REQUEST_ADDRESS_FOR_TRANSACTION = 6;
ACCEPT_REQUEST_ADDRESS_FOR_TRANSACTION = 7;
DECLINE_REQUEST_ADDRESS_FOR_TRANSACTION = 8;
REQUEST_TRANSACTION = 9;
SEND_TRANSACTION = 10;
DECLINE_REQUEST_TRANSACTION = 11;
SYNC_INSTALLATION_CONTACT_V2 = 12;
SYNC_INSTALLATION_ACCOUNT = 13;
CONTACT_CODE_ADVERTISEMENT = 15;
PUSH_NOTIFICATION_REGISTRATION = 16;
PUSH_NOTIFICATION_REGISTRATION_RESPONSE = 17;
PUSH_NOTIFICATION_QUERY = 18;
PUSH_NOTIFICATION_QUERY_RESPONSE = 19;
PUSH_NOTIFICATION_REQUEST = 20;
PUSH_NOTIFICATION_RESPONSE = 21;
EMOJI_REACTION = 22;
GROUP_CHAT_INVITATION = 23;
CHAT_IDENTITY = 24;
COMMUNITY_DESCRIPTION = 25;
COMMUNITY_INVITATION = 26 [deprecated=true];
COMMUNITY_REQUEST_TO_JOIN = 27;
PIN_MESSAGE = 28;
EDIT_MESSAGE = 29;
STATUS_UPDATE = 30;
DELETE_MESSAGE = 31;
SYNC_INSTALLATION_COMMUNITY = 32;
ANONYMOUS_METRIC_BATCH = 33;
SYNC_CHAT_REMOVED = 34;
SYNC_CHAT_MESSAGES_READ = 35;
BACKUP = 36;
SYNC_ACTIVITY_CENTER_READ = 37;
SYNC_ACTIVITY_CENTER_ACCEPTED = 38;
SYNC_ACTIVITY_CENTER_DISMISSED = 39;
SYNC_BOOKMARK = 40;
SYNC_CLEAR_HISTORY = 41;
SYNC_SETTING = 42;
COMMUNITY_MESSAGE_ARCHIVE_MAGNETLINK = 43;
SYNC_PROFILE_PICTURES = 44;
SYNC_ACCOUNT = 45;
ACCEPT_CONTACT_REQUEST = 46;
RETRACT_CONTACT_REQUEST = 47;
COMMUNITY_REQUEST_TO_JOIN_RESPONSE = 48;
SYNC_COMMUNITY_SETTINGS = 49;
REQUEST_CONTACT_VERIFICATION = 50;
ACCEPT_CONTACT_VERIFICATION = 51;
DECLINE_CONTACT_VERIFICATION = 52;
SYNC_TRUSTED_USER = 53;
SYNC_VERIFICATION_REQUEST = 54;
SYNC_CONTACT_REQUEST_DECISION = 56;
COMMUNITY_REQUEST_TO_LEAVE = 57;
SYNC_DELETE_FOR_ME_MESSAGE = 58;
SYNC_SAVED_ADDRESS = 59;
COMMUNITY_CANCEL_REQUEST_TO_JOIN = 60;
CANCEL_CONTACT_VERIFICATION = 61;
SYNC_KEYPAIR = 62;
SYNC_SOCIAL_LINKS = 63;
SYNC_ENS_USERNAME_DETAIL = 64;
reserved 65;
reserved "SYNC_ACTIVITY_CENTER_NOTIFICATIONS";
// No need to sync AC state now since we allow exist different number of ACs between paired devices
// Also we will update AC state after sync AC decision
reserved 66;
reserved "SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE";
COMMUNITY_EVENTS_MESSAGE = 67;
COMMUNITY_EDIT_SHARED_ADDRESSES = 68;
SYNC_ACCOUNT_CUSTOMIZATION_COLOR = 69;
SYNC_ACCOUNTS_POSITIONS = 70;
COMMUNITY_EVENTS_MESSAGE_REJECTED = 71;
COMMUNITY_PRIVILEGED_USER_SYNC_MESSAGE = 72;
COMMUNITY_SHARD_KEY = 73;
SYNC_CHAT = 74;
SYNC_ACTIVITY_CENTER_DELETED = 75;
SYNC_ACTIVITY_CENTER_UNREAD = 76;
SYNC_ACTIVITY_CENTER_COMMUNITY_REQUEST_DECISION = 77;
SYNC_TOKEN_PREFERENCES = 78;
COMMUNITY_PUBLIC_SHARD_INFO = 79;
SYNC_COLLECTIBLE_PREFERENCES = 80;
COMMUNITY_USER_KICKED = 81;
}
}