Commit Graph

298 Commits

Author SHA1 Message Date
Samuel Hawksby-Robinson a9c7db6f25 chore(no-torrent)_: Replaced entirely LogStdout with default logger 2024-06-07 13:44:12 +01:00
Samuel Hawksby-Robinson 6b5b738662 chore(no-torrent)_: Fixed torrent tests 2024-06-07 13:44:12 +01:00
Samuel Hawksby-Robinson bf5ab8c46b chore(no-torrent)_: moved archive related funcs into ArchiveManager
To be honest once I started this work I quickly realised how pointless it is as archiving functionality and torrent seeding functionality are really entwined. So I'm keeping the code I've done but it is a bit pointless without spending a lot of time untangling torrenting and archiving. I'm just going to make an interface for all the functions that are used publically from TorrentManager. I think that this will be the fast way to move on from this issue. I don't like this work any more, there is a lot of work to do elsewhere and torrent is a rabbit hole filled with canned worms.
2024-06-07 13:44:12 +01:00
Samuel Hawksby-Robinson 4761b1245e chore(no-torrent)_: removed TorrentManager from checkIfIMemberOfCommunity 2024-06-07 13:44:12 +01:00
Samuel Hawksby-Robinson 66d57a3fd0 chore(no-torrent)_: Unexported all exported funcs not used externally 2024-06-07 13:44:12 +01:00
Samuel Hawksby-Robinson 93256fc252 chore(no-torrent)_: Made torrentClientReady() belong to TorrentManager 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
Michal Iskierko b38a9f5878 fix_: Publish token actions to privileged members
Send information to owners and token masters about operations: burn, airdrop, remote destruct.
Add CommunityTokenActionSignal to signalize client side.

Fix #13371
2024-06-03 12:19:19 +02:00
Mykhailo Prakhov 2053bd323b
fix(community)_: handle outdated request to join and request to join response when we have been joined (#5271) 2024-05-31 19:16:45 +02:00
Jonathan Rainville 64d2860571
chore_: remove Light permission checks that are no longer needed (#5267) 2024-05-31 10:22:08 -04:00
Mykhailo Prakhov 3cae2e06f3
fix(ActivityCenterNotification)_: update pending state of request to join ActivityCenterNotification when member was joined (#5242) 2024-05-28 17:02:30 +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
Michal Iskierko 6f1b82966a feat_: light, no-network versions of permission checking functions
Light functions are based on the fact that permissions are met if the user is on community/channel member list.
If the user is not on the list, permissions will not be met and the client is responsible to use regular permissions-check functions.
For all permissions-check functions, corresponding light versions are added: CheckAllChannelsPermissionsLight,
CheckChannelPermissionsLight, CheckPermissionToJoinLight.

Issue #14220
2024-05-20 14:17:40 +02:00
Michal Iskierko 574450289c feat_: Move community tokens transaction listening to status-go
Use EventWatcher to catch wallet events.
Handling all community tokens wallet events in communitytokens service (database and messenger operations).
Adding new signal to nim: CommunityTokenTransactionSignal, which is emitted everytime when the event is received.

Issue #4351
2024-05-16 16:18:15 +02:00
Jonathan Rainville 5ca1cb0a0f
fix(messenger)_: make sure chats have an unread count of 0 for channels you can't view (#5062)
Fixes https://github.com/status-im/status-desktop/issues/14421

The problem is that you can receive messages to  a channel, then later, before marking them as read, a permission is added to them, so you no longer have access.
Then, you can't even mark it as read if it's hidden.
Here, I fix it by setting the unread count on Init at 0 if the user doesn't have view access to it. And I make sure we update the counts when we are removed from a channel
2024-05-15 15:57:12 -04:00
Godfrain Jacques 627e23ffa5
fix_: mitigate permission stuck in pending state (#5070)
This PR mitigates permission stuck in pending state upon making device a
control node. It fixes [#14023](status-im/status-desktop#14023)
2024-05-10 08:56:40 -07: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
Andrey Bocharnikov 8cd4560823 fix(communities)_: prepare messages content for GetCommunityMemberAllMessages
Fixes #14060
2024-05-09 20:27:05 +07: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 1c43b7a29b
chore_: better community json log (#5118) 2024-05-08 15:49:41 +01:00
frank 8c5a735438 feat_: retry sending specific messages 2024-05-02 05:40:49 +08:00
Ajay Sivan 0ef4fb8cc7
chore_: log revealed addresses on join/edit (#5073) 2024-04-24 18:54:25 -07:00
Mikhail Rogachev 6da423fc71
feat: Add an expiration and periodical publishing for community grants (#5024)
* feat_: add periodical publishing for community grants
feat_: Validate grant when receiving it
feat_: add expiration for grants
feat_: add test for grants expiration
fix_: move grants test to profile showcase, fix a few bugs
* feat_: use one group mesage to update grants
* chore_: review fixes
2024-04-17 16:53:51 +02:00
Godfrain Jacques e6fee1a84e
fix_: token-permitted channel input not locked (#5046)
Issue #14117
2024-04-10 10:51:58 -07:00
Ibrahem Khalil 18cc3a16d5
Return request to join acceptance notifications (#4909) 2024-04-09 21:32:03 +02:00
yqrashawn aa73a0512c
feat: add contact customization color (#4869) 2024-04-03 22:49:57 +08:00
Patryk Osmaczko 7f44d4d12a refactor: remove unused `COMMUNITY_EVENTS_MESSAGE_REJECTED` 2024-03-25 13:18:20 +01:00
Mikhail Rogachev c7e7445f5c
Fix: ignore nil contact 'IsDisplayNameDupeOfCommunityMember' (#4956) 2024-03-21 20:43:51 +01:00
Patryk Osmaczko 0aed93ff04 fix: encrypt community's Categories and ActiveMembersCount
fixes: #4943
fixes: #4944
2024-03-20 18:41:07 -04:00
Mykhailo Prakhov ad342c8887
feat: get and delete community member messages API (#4932) 2024-03-19 20:44:49 +01:00
Michal Iskierko 8bf03609fc feat: Add HideIfPermissionsNotMet to CommunityChat struct
Issue #13291
2024-03-18 15:01:29 +01:00
Patryk Osmaczko b02e3b19e2 feat: add permissions reevaluation request
Token master can't manage members directly, so it must request
reevaluation from the control node.

fixes: status-im/status-desktop#13778
2024-03-12 14:15:01 +01:00
Mikhail Rogachev 5d29c20f94
Feat: Add 'IsDisplayNameDupeOfCommunityMember' endpoint (#4839)
* feat: Add 'TestScanCommunitiesMembersForName' endpoint

* feat: validate display name amoung community members
2024-03-01 15:46:48 +03:00
Mykhailo Prakhov 77214dcb5d
feat: admins can delete all members messages during the ban (#4834) 2024-02-29 18:54:17 +01: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 eeaff0d3e3 fix: sync&backup channels encryption keys
fixes: status-im/status-desktop#13356
2024-02-26 16:41:30 +01:00
Mykhailo Prakhov 92bc64bb41
feat: kicked/banned member should not have spectated mode after the kick/ban (#4806) 2024-02-26 13:33:07 +01:00
Mykhailo Prakhov 3959948c4c
chore: fix ban/unban flow and delete all messages feature (#4743)
feat: delete all messages for banned member and ban/unban AC notifications
2024-02-22 11:25:13 +01:00
Patryk Osmaczko e2cab1a8ae fix: ensure community events eventual consistency
- Extracted `community_events_factory.go`
- Introduced `eventsProcessor`
  - Improved processing logic order
  - Improved events filtering
- Introduced concept of `EventTypeID` to prevent redundant events handling
- Added sanity check before events appliance when reading community from
  database
- Removed reject&re-apply scheme (no more ping-pong issue)
- Fixed and added more variants to eventual consistency test

fixes: status-im/status-desktop#13387
fixes: status-im/status-desktop#13388
2024-02-20 21:07:01 +01:00
Pablo Lopez 3f19972c8e
enable custom community storenodes (#4532)
* enable custom community store nodes

* fix

* fix

* fix

* fix

* cleanup

* fix

* migration

* fix

* cleanup

* fix

* cleanup

* fix

* fix

* cleanup

* message to update the community storenodes

* rename

* fix test

* wait for availability only if global storenode

* fix test

* fix typo

* sync community storenodes

* remove unused

* add tests

* fix imports

* fix todo

* unused

* pr comments

* pr feedback

* revert merge deleted

* fix lint

* fix db and perform ms request

* typo

* fix log

* fix go imports

* refactor handle message

* cleanup public message

* add tests

* fix test

* cleanup test

* fix test

* avoid making one file to big to keep codeclimate from complaining

* fix lint

* revert

* Update protocol/storenodes/database.go

Co-authored-by: richΛrd <info@richardramos.me>

* Update protocol/messenger_mailserver_cycle.go

Co-authored-by: richΛrd <info@richardramos.me>

* PR comment

* fix tx

* proto files

* pr comment

---------

Co-authored-by: richΛrd <info@richardramos.me>
2024-02-20 17:49:39 +02:00
Cuteivist a866b8025e
feat: Community token received notification (#4682) 2024-02-19 14:55:38 +01:00
Andrea Maria Piana 27f0884b51 Exclude watch only accounts from permissions checks 2024-02-14 17:03:28 +00:00
Mikhail Rogachev 9b7926b23b
feat: delete profile showcase community entry on community leave or kicked (#4686) 2024-02-09 12:37:54 +03: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
Icaro Motta 4f8a66fc07 Create endpoint to get permissioned balances 2024-02-07 20:10:49 +00:00
Jonathan Rainville 18e7b6c331
Fix Discord Import getting stuck (#4681)
* fix(community_import): fix import getting stuck in case of error in msgs

Fixes #13438 and #13439

* fix(community_import): fixes a bug with the timestamp format

The importer didn't like `-` time zones like `-4`. Using the standard date format makes it work.
2024-02-07 13:02:47 -05: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
richΛrd 98c1ebec05
fix: handle community shard unassignment and update (#4627) 2024-01-30 13:56:59 -04: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 4a7d15b36d fix: use CommunityShardKey's clock rather than community's clock 2024-01-29 21:31:11 +01:00