Commit Graph

75 Commits

Author SHA1 Message Date
Jonathan Rainville 621b31a279
fix(community)_: fix pure readonly channels not respecting the right roles (#5513)
Fixes https://github.com/status-im/status-desktop/issues/15547
2024-07-15 13:53:20 -04:00
Prem Chaitanya Prathi 9a703162c4
refactor: only use shards (#5474)
* refactor_: use shards by default

* fix_: metadata lightclient check

* chore_: update go-waku
2024-07-15 20:55:12 +05:30
Mykhailo Prakhov 7ec5b18642 fix(CommunitySharedAddresses)_:
- TokenMaster request shared addresses on restoring from a backup
- Fixes sharing members revealed adresses
- Filter out outdated ApplicationMetadataMessage_COMMUNITY_PRIVILEGED_USER_SYNC_MESSAGE messages
2024-07-09 18:19:40 +02:00
Mykhailo Prakhov 6333e2a053 fix(CommunityMember)_: update LastUpdateClock 2024-07-09 18:19:40 +02:00
Michal Iskierko 3145ab05ff feat(community tokens)_: Upgrade ERC721 contract to enable batch transfers
Add version field to proto and database.

Issue #4947
2024-07-08 11:30:51 +02:00
Mykhailo Prakhov fc401bc8a7
fix(communities)_: kick AC notification after control node device change (#5472)
fix(communities)_: kick AC notification after control node device change
2024-07-05 10:38:12 +02:00
Patryk Osmaczko cb20c4c64a feat(communities)_: introduce bloom filter members list
iterates: status-im/status-desktop#15064
2024-07-04 17:54:29 +02:00
Patryk Osmaczko 88c671fcf0 fix(communities)_: correct >1 NFT token requirement evaluation
Fixed logic to respect specified NFT quantities. Previously, holding one
NFT sufficed, regardless of the required count.

fixes: status-im/status-desktop#15122
2024-06-20 15:23:38 +02:00
Jonathan Rainville 4a63201a79
fix_: send request for shared addresses when restoring a community (#5314)
* fix_: send request for shared addresses when restoring a community

Needed for https://github.com/status-im/status-desktop/issues/14289

When someone restores a community that they joined, it now sends a message to the control node to get their shared addresses back.

It's lighter that backing up the addresses all the time on waku and should only be needed once.

* fix_: filter communities before to avoid passing `alreadyHandled` parameter to `requestCommunityKeysAndSharedAddresses`

---------

Co-authored-by: Patryk Osmaczko <osmaczkopatryk@gmail.com>
2024-06-14 13:32:55 -04:00
Patryk Osmaczko 2d4ef8b2e0 chore(communities)_: cover ERC721 based permissions reevaluation with tests 2024-06-07 23:46:20 +02:00
Mikhail Rogachev b0213e6a41
feat_: delete or update permission when deleting a channel (#5297)
* feat_: delete or update channel permissions when deleting a channel

* chore_: review fixes

* chore_: review fixes (second iteration, squash it!)
2024-06-07 18:30:01 +02:00
Samuel Hawksby-Robinson 3d68013332 chore(no-torrent)_: Renamed Torrent to Archive
I've renamed TorrentManager to ArchiveManager, ArchiveManager to ArchiveFileManager, TorrentContract to ArchiveService, ArchiveContract to ArchiveFileService. I've also renamed all init functions and struct fields to the appropriate archive-centric naming.
2024-06-07 13:44:12 +01:00
Samuel Hawksby-Robinson 9b458c63e0 chore(no-torrent)_: I've fully split Manager from TorrentManager
I've removed any mention or dependency of TorrentManager from Manager. There is still more work to do, but Messenger now communicates directly with a TorrentManager rather than asking the communities Manager to handle it. I've ensured that LogStdout() is only called from TorrentManager and removed entirely from Manager, this functionality seems to be some kind of debug tool specifically for torrent related functionality. Next I need to focus on functions within Messenger that call a TorrentManager and see how to isolate these from the main flows, following that I also need fix the tests that are broken. I will also need to refactor torrentClientReady() so that it is a function of TorrentManager, this may allow for pushing more functions into TorrentManager which will lead to better torrent encapsulation.
2024-06-07 13:44:12 +01:00
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