From 22e727ee73f25f3469bccf5d7325f8930bb9348d Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Fri, 15 Mar 2024 11:04:03 +0900 Subject: [PATCH] handle larger messages (#531) * p * u * f * u * c --- .changeset/smart-tips-wash.md | 5 + .../protos/application-metadata-message.proto | 123 +++-- .../protos/application-metadata-message_pb.ts | 438 +++++++++++++++--- .../src/request-client/request-client.ts | 15 +- patches/it-length-prefixed+9.0.3.patch | 15 + 5 files changed, 482 insertions(+), 114 deletions(-) create mode 100644 .changeset/smart-tips-wash.md create mode 100644 patches/it-length-prefixed+9.0.3.patch diff --git a/.changeset/smart-tips-wash.md b/.changeset/smart-tips-wash.md new file mode 100644 index 00000000..12f91c7e --- /dev/null +++ b/.changeset/smart-tips-wash.md @@ -0,0 +1,5 @@ +--- +'@status-im/js': patch +--- + +set MAX_DATA_LENGTH diff --git a/packages/status-js/src/protos/application-metadata-message.proto b/packages/status-js/src/protos/application-metadata-message.proto index 79fe4351..eb0c0665 100644 --- a/packages/status-js/src/protos/application-metadata-message.proto +++ b/packages/status-js/src/protos/application-metadata-message.proto @@ -10,39 +10,94 @@ message ApplicationMetadataMessage { Type type = 3; enum Type { - TYPE_UNKNOWN_UNSPECIFIED = 0; - TYPE_CHAT_MESSAGE = 1; - TYPE_CONTACT_UPDATE = 2; - TYPE_MEMBERSHIP_UPDATE_MESSAGE = 3; - TYPE_PAIR_INSTALLATION = 4; - TYPE_SYNC_INSTALLATION = 5; - TYPE_REQUEST_ADDRESS_FOR_TRANSACTION = 6; - TYPE_ACCEPT_REQUEST_ADDRESS_FOR_TRANSACTION = 7; - TYPE_DECLINE_REQUEST_ADDRESS_FOR_TRANSACTION = 8; - TYPE_REQUEST_TRANSACTION = 9; - TYPE_SEND_TRANSACTION = 10; - TYPE_DECLINE_REQUEST_TRANSACTION = 11; - TYPE_SYNC_INSTALLATION_CONTACT = 12; - TYPE_SYNC_INSTALLATION_ACCOUNT = 13; - TYPE_SYNC_INSTALLATION_PUBLIC_CHAT = 14; - TYPE_CONTACT_CODE_ADVERTISEMENT = 15; - TYPE_PUSH_NOTIFICATION_REGISTRATION = 16; - TYPE_PUSH_NOTIFICATION_REGISTRATION_RESPONSE = 17; - TYPE_PUSH_NOTIFICATION_QUERY = 18; - TYPE_PUSH_NOTIFICATION_QUERY_RESPONSE = 19; - TYPE_PUSH_NOTIFICATION_REQUEST = 20; - TYPE_PUSH_NOTIFICATION_RESPONSE = 21; - TYPE_EMOJI_REACTION = 22; - TYPE_GROUP_CHAT_INVITATION = 23; - TYPE_CHAT_IDENTITY = 24; - TYPE_COMMUNITY_DESCRIPTION = 25; - TYPE_COMMUNITY_INVITATION = 26; - TYPE_COMMUNITY_REQUEST_TO_JOIN = 27; - TYPE_PIN_MESSAGE = 28; - TYPE_EDIT_MESSAGE = 29; - TYPE_STATUS_UPDATE = 30; - TYPE_DELETE_MESSAGE = 31; - TYPE_SYNC_INSTALLATION_COMMUNITY = 32; - TYPE_ANONYMOUS_METRIC_BATCH = 33; + 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; + SYNC_PROFILE_SHOWCASE_PREFERENCES = 82; + COMMUNITY_PUBLIC_STORENODES_INFO = 83; + COMMUNITY_REEVALUATE_PERMISSIONS_REQUEST = 84; } } diff --git a/packages/status-js/src/protos/application-metadata-message_pb.ts b/packages/status-js/src/protos/application-metadata-message_pb.ts index a1583b5e..a04f9dc3 100644 --- a/packages/status-js/src/protos/application-metadata-message_pb.ts +++ b/packages/status-js/src/protos/application-metadata-message_pb.ts @@ -36,7 +36,7 @@ export class ApplicationMetadataMessage extends Message) { super() @@ -96,213 +96,497 @@ export class ApplicationMetadataMessage extends Message