Commit Graph

62 Commits

Author SHA1 Message Date
Mykhailo Prakhov bb09cd328f
fix(test)_: TestResendEncryptionKeyOnBackupRestore test performance fix (#5236) 2024-05-27 16:29:06 +02:00
Igor Sirotin 19875ed9b5
fix: archive decryption fail (#5076)
* fix_: delay archive import if decryption failed

* chore_: minor cleanup

* chore_: test archive import of encrypted channel

* test(TestImportDecryptedArchiveMessages)_: first iteration

* feat_: GetHashRatchetMessagesCountForGroup

* chore_: log community description and shard info message ids

* test(TestImportDecryptedArchiveMessages)_: cleanup

* fix_: rebase issues

* chore_: remove temporal test

* test(TestImportDecryptedArchiveMessages)_: cleanup

* chore_: lint fix

* fix(TestImportDecryptedArchiveMessages)_: ForceMembersReevaluation
2024-05-27 13:49:09 +01:00
Patryk Osmaczko 709d75d69c fix_: flaky testReevaluateMemberPrivilegedRoleInClosedCommunity
`waitOnCommunitiesEvent` must be invoked before action that triggers
the event.

fixes: #4578
fixes: #4761
2024-05-23 20:15:36 +02:00
Patryk Osmaczko cec5985066 chore(communities)_: separate changes application in `reevaluateMembers`
This avoids locking of the community until the end of reevaluation.

There is no special handling for community changes while reevaluation is
ongoing. If members are added or removed, the function will behave
correctly. If permissions are changed, they will be accommodated in the
next reevaluation.

fixes: status-im/status-desktop#14775
2024-05-23 09:52:38 +02:00
Patryk Osmaczko 97af3f7e52 fix_: flaky TestJoinCommunityAsMemberWithMemberAndAdminPermission
`waitOnCommunitiesEvent` must be invoked before action that triggers
the event.

fixes: #4760
2024-05-22 20:42:52 +02:00
Mykhailo Prakhov 6fbf2cf17f
chore(tests)_: createCommunityConfigurable creates only one chat (#5204) 2024-05-22 15:08:44 +02:00
Mykhailo Prakhov 77541725aa
chore(community)_: reevaluateMembers optimization (#5169)
* chore(community)_: reevaluateMembers optinizations
2024-05-17 18:15:39 +02:00
Jonathan Rainville ae08ba6ad1
feat(search)_: filter out messages from non-viewable channels (#5161)
Fixes https://github.com/status-im/status-desktop/issues/14586
2024-05-16 12:41:04 -04:00
Mykhailo Prakhov cb4c19cece
feat(encryption)_: request control node to resend ecnryption keys during restoring account by a seed phrase (#5142) 2024-05-10 10:04:46 +02:00
Igor Sirotin 349ea8ad6e
feat_: force members reevaluation (#5139)
* chore_: enable adding community manager options from messenger config

* chore_: make `reevaluateMembers` private method

* fix(MessengerCommunitiesTokenPermissionsSuite)_: proper waiting

* feat_: `ForceMembersReevaluation` method

* test_: increate some test timeouts
2024-05-09 22:59:51 +03:00
Igor Sirotin 529c658374
fix_: flaky TestSharedAddressesReturnsRevealedAccount (#5137) 2024-05-09 00:54:28 +01:00
Igor Sirotin 3e4367a7cf
fix_: community members reevaluation fixes (#5117)
* fix_: prevent publishing older community description

* fix_: schedule member reevaluation instead of reevaluating in parallel

* fix_: lock community on members reevaluation

* fix(TestJoinCommunityAsAdminWithMemberAndAdminPermission)_: setup waitOnCommunitiesEvent in advance

* fix(TestEditSharedAddresses)_: remove redundant community description retrieval
2024-05-08 16:32:46 +01:00
Igor Sirotin 522f3288b0
chore_: uncomment and skip TestBecomeMemberPermissions (#5121) 2024-05-08 15:53:34 +01:00
Godfrain Jacques e6fee1a84e
fix_: token-permitted channel input not locked (#5046)
Issue #14117
2024-04-10 10:51:58 -07:00
Andrea Maria Piana 894eb5758e Add canView to chat & fix admin role 2024-03-20 16:48:07 -04:00
Jonathan Rainville 3f1547fc63 chore: add test that validates that the member role gets updated 2024-03-12 11:04:45 -04:00
Igor Sirotin bdb2b261a6
feature: view only channel reactions (#4820)
* CommunityMember channel role

* make generate
2024-03-01 17:15:38 +00:00
Michal Iskierko df930b1d73 feat: New field in TokenCriteria proto
AmountInWei will have a wei-like units.
Amount field becomes deprecated because it kept string with float value.

Comparison (in case of Decimals == 5):
Amount (deprecated) = "1.2"
AmountInWei = "120000"

Issue #11588
2024-02-27 16:25:26 +01:00
Patryk Osmaczko 5aed0d178f chore: unskip flaky tests 2024-02-27 11:00:29 +01:00
Igor Sirotin 515dbdf2b3
fix: waku connection status subscription lock (#4762)
* fix: lock waku connStatus subscription for sending
* update skipped tests
2024-02-19 23:44:38 +00:00
Patryk Osmaczko 30f4edf48d fix: keep flaky tests compilable and easy to find 2024-02-19 21:46:35 +01:00
Patryk Osmaczko 1fca1e1743 Revert "Comment out flaky tests (#4741)"
This reverts commit 582927868d.
2024-02-19 21:46:35 +01:00
Roman Volosovskyi 582927868d
Comment out flaky tests (#4741) 2024-02-19 10:10:37 +01:00
Igor Sirotin 44c39d345e
chore: testWakuV2Config (#4704)
* chore: testWakuV2Config

* renamed to `NewTestWakuV2`
2024-02-12 12:53:15 +00:00
Andrea Maria Piana c49a0fc314 [Fixes: #4687] Change requestsToJoinCommunity to a map
The test was flaky because of re-receiving the message, which resulted
in multiple identical requestsToJoin being added to messengerResponse.

We should in general avoid using arrays in messengerResponse and prefer
maps for exactly this reason.
2024-02-08 11:18:53 +00:00
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
Igor Sirotin 1f0fc2935c
fix: clear waku envelopes cache when deleting a chat (#4621)
* chore: extract `ErrPermissionToJoinNotSatisfied`
* chore: disable resending messages in communities tests
* chore: move newTestMessenger extraOptions to testMessengerConfig
* chore: `WithTestStoreNode` messenger option
* feat: waku `ClearEnvelopesCache` method
* fix: call `ClearEnvelopesCache` when deleting chat
* chore: `TestBecomeMemberPermissions` checks messages after rejoin
2024-01-30 13:43:34 +00:00
Patryk Osmaczko 5162c285a8 refactor: introduce `newTestCommunitiesMessenger` 2024-01-24 14:24:57 +01:00
Patryk Osmaczko 92f43bac78 chore: extend `CreateWakuV2Network` with `useShardAsDefaultTopic` 2024-01-24 14:24:57 +01:00
Andrea Maria Piana e65760ca85 Add basic peersyncing
This commit adds basic syncing capabilities with peers if they are both
online.

It updates the work done on MVDS, but I decided to create the code in
status-go instead, since it's very tight to the application (similarly
the code that was the inspiration for mvds, bramble, is all tight
together at the database level).

I reused parts of the protobufs.

The flow is:

1) An OFFER message is sent periodically with a bunch of message-ids and
   group-ids.
2) Anyone can REQUEST some of those messages if not present in their
   database.

3) The peer will then send over those messages.

It's disabled by default, but I am planning to add a way to set up the
flags.
2024-01-23 12:46:17 +00:00
Roman Volosovskyi 0bd4a06edc Comment out all logged flaky tests 2024-01-18 06:36:12 +00:00
Patryk Osmaczko 1d3c618fb4 feat: encrypt `CommunityDescription` fields
Extended `CommunityDescription` with a `privateData` map. This map
associates each hash ratchet `key_id` and `seq_no` with an encrypted
`CommunityDescription`. Each encrypted instance includes only data
requiring encryption.

closes: status-im/status-desktop#12851
closes: status-im/status-desktop#12852
closes: status-im/status-desktop#12853
2023-12-22 18:17:06 +01:00
Patryk Osmaczko 4086e24365 fix: close messenger's databases in tests 2023-11-28 20:59:25 +01:00
Igor Sirotin e32c5546e1
test: request community from storenode (#4364)
* feat: request community info from storenode test

* shutdownWaitGroup

* fix requestCommunityInfoFromMailserver timestamp roundin
2023-11-25 23:24:20 +00:00
Sale Djenic 11a3612290 feat: support signing of a join/edit community request from within the app or keycard 2023-11-03 07:49:01 +01:00
Andrea Maria Piana d3558d8e09
Disable waku test 2023-11-01 19:27:53 +00:00
Andrea Maria Piana 360c2d50d4 Fix issues with out of order encryption and batched messages
This commit fixes 3 issues:

1) In some cases, the hash ratchet was not correctly found
2) Out of order messages were not processed correctly as the wrong error
   was returned
3) Batched non datasync messages were not processed correctly

Fixes: #4170
2023-10-30 10:11:32 +00:00
Vitaliy Vlasov 1fedf5503a Use WakuV2 in MessengerCommunitiesTokenPermissionsSuite 2023-10-11 12:56:38 +03:00
Jonathan Rainville eb6ed5ebae
fix(test): fix flaky permission test (#4080)
Fixes #4069
2023-10-04 10:14:11 -04:00
Vitaliy Vlasov e1354016a0 Comment away TestMessengerCommunitiesTokenPermissionsSuite 2023-10-04 00:39:33 +03:00
Mykhailo Prakhov db9adb631f
feat: share requests to join and revealed addresses with privileged roles (#3951)
- share requests to join with new privileged roles during reevaluating member role
- share requests to join with new members, joined the community as TOKEN_MASTER, ADMIN
- share requests to join revealed addresses to ADMINS and TOKEN_MASTERS
- refactor common test functionality to make them more predictable
- removed unused CommunityToken protobuf
2023-09-20 10:37:46 +02:00
Jonathan Rainville f7b342bb07
feat(shared_addresses): save own shared addresses in DB (#3950) 2023-08-29 14:56:30 -04:00
Patryk Osmaczko a12e87dac6 feat: add pending state for token permissions
iterates: status-im/status-desktop#11852
2023-08-23 10:34:59 +02:00
Patryk Osmaczko a31dea7988 fix: improve stability of `TestReevaluateMemberAdminRoleInClosedCommunity` 2023-08-23 10:34:59 +02:00
Mykhailo Prakhov 86d969727f
feat: share CommunityTokens between privileged users (#3931)
feat: sync CommunityTokens between privileged users
feat: restore PrivilegeLevel for synchronized CommunityToken
2023-08-22 19:48:42 +02:00
Patryk Osmaczko 8b9ee803e2 feat: auto re-apply rejected community events
closes: status-im/status-desktop#11552
2023-08-11 12:46:45 +02:00
Jonathan Rainville 1d2b508c20
fix(communities_manager): fix joining community with admin permission (#3870)
Fixes an issue where if a community had an admin permission, it would be impossible to join as a normal member because the admin permission wasn't satisfied.
2023-08-10 11:46:38 -04:00
Pascal Precht 688fb333a0 chore: don't expose `RevealedAccount`s on community description
Prior to this commit a control node would add the revealed addresses to
the member struct on the community description, which exposes all those
addresses to the public.

We don't want that. Revealed addresses are exclusively shared with
control nodes and should stay there (although, they might be privately
shared among token masters, see
https://github.com/status-im/status-desktop/issues/11610).

In this commit, we no longer add the revealed addresses to the community
description. The addresses are already stored in the requestToJoin
database table so we can take them from there if we need them.

Closes: https://github.com/status-im/status-desktop/issues/11573
2023-08-08 19:02:47 +02:00
Mykhailo Prakhov ebadfb3e7b
feat: allow owner without community private key to manage privileged community permissions (#3861)
feat: allow owner without community private key to manage privileged permissions
2023-08-08 17:02:56 +02:00
Mykhailo Prakhov 3bd972dec4
chore: Added TokenMaster permission token type (#3848) 2023-08-04 12:28:46 +02:00