Skip to content

Commit

Permalink
Add simple chat update message test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sashaweiss-signal authored Jul 8, 2024
1 parent b502388 commit 9147958
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Backup.proto
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,14 @@ message SimpleChatUpdate {
IDENTITY_VERIFIED = 3;
IDENTITY_DEFAULT = 4; // marking as unverified
CHANGE_NUMBER = 5;
BOOST_REQUEST = 6;
RELEASE_CHANNEL_DONATION_REQUEST = 6;
END_SESSION = 7;
CHAT_SESSION_REFRESH = 8;
BAD_DECRYPT = 9;
PAYMENTS_ACTIVATED = 10;
PAYMENT_ACTIVATION_REQUEST = 11;
UNSUPPORTED_PROTOCOL_MESSAGE = 12;
REPORTED_SPAM = 13;
}

Type type = 1;
Expand Down
Binary file added test-cases/simple-chat-update-message.binproto
Binary file not shown.
282 changes: 282 additions & 0 deletions test-cases/simple-chat-update-message.jsonproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
// Includes at least one message for each of the "simple chat updates".
[
{
"backupTimeMs": "123456",
"version": "1"
},
{
"account": {
"profileKey": "YQKRq+3DQklInaOaMcmlzZnN0m/1hzLiaONX7gB12dg=",
"givenName": "Boba",
"familyName": "Fett",
"avatarUrlPath": "",
"accountSettings": {
"readReceipts": false,
"sealedSenderIndicators": true,
"typingIndicators": false,
"linkPreviews": false,
"notDiscoverableByPhoneNumber": false,
"preferContactAvatars": false,
"universalExpireTimer": 0,
"preferredReactionEmoji": [],
"displayBadgesOnProfile": false,
"keepMutedChatsArchived": false,
"hasSetMyStoriesPrivacy": false,
"hasViewedOnboardingStory": false,
"storiesDisabled": false,
"storyViewReceiptsEnabled": false,
"hasSeenGroupStoryEducationSheet": false,
"hasCompletedUsernameOnboarding": false,
"phoneNumberSharingMode": "NOBODY"
}
}
},
{
"recipient": {
"id": "1",
"self": {}
}
},
{
"recipient": {
"id": "2",
"releaseNotes": {}
}
},
{
"recipient": {
"id": "3",
"contact": {
"aci": "X4xWjQEZR72BqruHybcZlQ==",
"profileKey": "YtHHVK+Wo4nPcVpWhC3roMEDu2Tw6kYc9JpLRMq1Q94=",
"profileSharing": true,
"profileFamilyName": "Solo",
"profileGivenName": "Han",
"registered": {},
"hideStory": false,
}
}
},
// Release Notes channel
{
"chat": {
"id": "1",
"recipientId": "2"
}
},
// 1:1 chat with Contact recipient 3
{
"chat": {
"id": "2",
"recipientId": "3"
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "1",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "JOINED_SIGNAL"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "2",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "IDENTITY_UPDATE"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "3",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "IDENTITY_VERIFIED"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "4",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "IDENTITY_DEFAULT"
}
}
}
},
{
"chatItem": {
"authorId": "2",
"chatId": "1",
"dateSent": "5",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "RELEASE_CHANNEL_DONATION_REQUEST"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "6",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "CHANGE_NUMBER"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "7",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "END_SESSION"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "8",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "CHAT_SESSION_REFRESH"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "9",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "BAD_DECRYPT"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "10",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "PAYMENTS_ACTIVATED"
}
}
}
},
{
"chatItem": {
"authorId": "1",
"chatId": "2",
"dateSent": "11",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "PAYMENTS_ACTIVATED"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "12",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "PAYMENT_ACTIVATION_REQUEST"
}
}
}
},
{
"chatItem": {
"authorId": "1",
"chatId": "2",
"dateSent": "13",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "PAYMENT_ACTIVATION_REQUEST"
}
}
}
},
{
"chatItem": {
"authorId": "3",
"chatId": "2",
"dateSent": "14",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "UNSUPPORTED_PROTOCOL_MESSAGE"
}
}
}
},
{
"chatItem": {
"authorId": "1",
"chatId": "2",
"dateSent": "14",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "UNSUPPORTED_PROTOCOL_MESSAGE"
}
}
}
},
{
"chatItem": {
"authorId": "1",
"chatId": "2",
"dateSent": "15",
"directionless": {},
"updateMessage": {
"simpleUpdate": {
"type": "REPORTED_SPAM"
}
}
}
}
]

0 comments on commit 9147958

Please sign in to comment.