Commit Graph

335 Commits

Author SHA1 Message Date
Siddarth Kumar d6c4682479
chore_: bump go to 1.20 (#5027)
This commit attempts to upgrade go version to 1.20.12
This commit also removes the following items from lint checks :
* `goconst`
* `structcheck`
* `deadcode`
* `golint`
* `varcheck`

Mobile PR for QA purposes -> https://github.com/status-im/status-mobile/pull/19564
2024-04-18 18:48:02 +02:00
Patryk Osmaczko bd91f5ab49 fix_: keep community locks map unreleased when Manager stops
`ReevaluateMembers` is run as a separate goroutine and sometimes it is
executed after `Manager` has been stopped. It tries to use the lock and
in consequence, it panics. Ensuring the map is still there prevents that.

^Happened in test: `TestCreateTokenPermission`.
2024-04-17 17:31:38 +02:00
Patryk Osmaczko 9d309886f7 fix_: mitigate race conditions on community
mitigates: status-im/status-desktop#14432
2024-04-17 17:31:38 +02: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
Jonathan Rainville 6c82a6c2be fix(manager): make both perms satisfied if viewAndPost is satisfied
Fixes https://github.com/status-im/status-desktop/issues/14209
2024-04-04 14:34:59 -04:00
yqrashawn aa73a0512c
feat: add contact customization color (#4869) 2024-04-03 22:49:57 +08:00
Mykhailo Prakhov 3c76fdc626
fix: crash in dbRecordBundleToCommunity if event was signed not by a control node (#5009) 2024-04-03 14:51:28 +02:00
Igor Sirotin 3bd00cb416
chore: log incorrect amountInWeis (#5005) 2024-04-02 14:54:24 +01:00
Patryk Osmaczko 5b7910ae5a fix: validate community events read from database
Despite the expectation that only validated events are stored in the
database, instances have been identified where invalid events are saved.
This can lead to unexpected behavior or crashes.

This commit adds validation for community events read from the database
to prevent such cases.

**NOTE**: this fix does not address the root cause, which involves
invalid events being saved to the database. The exact scenario leading
to this issue has yet to be identified.

mitigates: status-im/status-desktop#14106
2024-03-27 14:31:03 +01:00
Igor Sirotin 1a2880b365
Fix/community tags indices (#4992)
* fix: strict order of community tags

* make tags containers private

* fix RandomCommunityTags implementation
2024-03-26 20:02:12 +00:00
Patryk Osmaczko 7f44d4d12a refactor: remove unused `COMMUNITY_EVENTS_MESSAGE_REJECTED` 2024-03-25 13:18:20 +01:00
Mykhailo Prakhov b931a75bd8
fix: crash on control node side dutring handling edited shared address from the member who left the community (#4967) 2024-03-22 15:25:37 +01:00
Patryk Osmaczko 0aed93ff04 fix: encrypt community's Categories and ActiveMembersCount
fixes: #4943
fixes: #4944
2024-03-20 18:41:07 -04:00
Andrea Maria Piana 894eb5758e Add canView to chat & fix admin role 2024-03-20 16:48:07 -04:00
Mykhailo Prakhov a1033f466a
feat: add new CommunityMemberState - CommunityMemberBanWithAllMessagesDelete (#4941) 2024-03-19 14:40:23 +01:00
Patryk Osmaczko 17c5ab414b fix: ensure `CommunityDescription` reprocessing on decryption failure
Previously, `CommunityDescription` instances failing partial decryption
were not reprocessed due to duplicate message check. This commit fixes
the issue by bypassing the check for such descriptions, allowing their
reprocessing upon receiving missing encryption key.

fixes: status-im/status-desktop#13647
2024-03-18 22:24:24 +01:00
Michal Iskierko 8bf03609fc feat: Add HideIfPermissionsNotMet to CommunityChat struct
Issue #13291
2024-03-18 15:01:29 +01:00
Andrea Maria Piana 67dfff2324 Add index to hash ratchet & cache processed description 2024-03-13 11:35:11 +00:00
Jonathan Rainville 6f119b9c53 fix(community): fix member role not being updated 2024-03-12 11:04:45 -04:00
Jonathan Rainville 605e3a4ed0 fix(community): fix editing a community channel loses the members 2024-03-12 11:04:45 -04:00
Jonathan Rainville e3810148d8 feat: add ViewersCanPostReactions to Chat object
Needed https://github.com/status-im/status-desktop/issues/13523
2024-03-12 11:04:45 -04: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
Patryk Osmaczko 1de61d1933 fix: channel members evaluation on request acceptance
If there is only `viewAndPost` permission set on a channel, members who
don't satisfy the criteria shouldn't be able to view the channel.
2024-03-12 14:15:01 +01:00
Igor Sirotin bdb2b261a6
feature: view only channel reactions (#4820)
* CommunityMember channel role

* make generate
2024-03-01 17:15:38 +00:00
Mykhailo Prakhov 84713384bb
fix: TestAdminBanMemberWithDeletingAllMessages test fix (#4855) 2024-03-01 17:37:20 +01:00
Jonathan Rainville 390d706b3f
fix: fix permission criteria being empty (#4841)
Fixes https://github.com/status-im/status-desktop/issues/13775
2024-02-29 16:25:34 -05: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
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
frank 4581c4f5f7
fix: sometimes channels do not randomly appear in test community after its creation (#4669) 2024-02-23 10:16:51 +08:00
Michał Iskierko ba7faea027
fix: Use correct chains when checking permissions: mainnet or testnet (#4793)
Fix #18896
2024-02-22 10:17:35 -05: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
Mikhail Rogachev eb5bad4868
Feat: Profile showcase validate collectible ownership (#4737)
* feat: profile showcase checks then presenting collectibles

* chore: more obvious CollectiblesManager configuration
2024-02-22 11:08:58 +03: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
Patryk Osmaczko f7c40d4c40 chore: use lamport timestamp for events clock
- make clock logical per event type
- increase clock precision to millisecends

Rationale:
https://www.notion.so/Eventual-consistency-9d6a9c6c55c14ab1aee76f801301522b

iterates: status-im/status-desktop#13387
2024-02-20 21:07:01 +01:00
Mikhail Rogachev 526e3d74f1
Feat: proof of membership for profile showcase communities (#4713)
* chore: move profile showcase structures to the indentity package

* feat: implement proof of membership for unecrypted communities

* feat: implement proof of membership for encrypted communties with grants
2024-02-15 22:13:12 +03:00
Andrea Maria Piana 598e3217ba Signal user if the networks are not supported 2024-02-13 12:09:46 +00:00
Igor Sirotin 5e905518aa
fix: missing fields in Communtiy CreateDeepCopy (#4718) 2024-02-12 23:26:32 +00:00
Andrea Maria Piana daef5c56e2 Add HighestRole & ordered roles to permission response
This commit adds HighestRole & a list of permissions in order of
importance to the CheckPermissionToJoinResponse.

This simplify client code so that it doesn't need to be calculated on
the client.
2024-02-12 12:18:56 +00:00
Mikhail Rogachev 3ea2002904
Feat: Modify grants for profile showcase use (#4694)
* chore: regenerate proto binaries

* feat: remove unused grant code for community's canPost
2024-02-11 15:11:04 +03:00
Michal Iskierko cc66f43713 fix: fix permissions checker
Improve CheckPermissions function.
Check separately member and admin+tokenmaster permissions..

Issue #12884
2024-02-09 19:00:43 +01:00
Icaro Motta e7e6782241 Fix: linter error 2024-02-07 20:10:49 +00:00
Icaro Motta 31277f1e9e Fix: cover case where criteria doesn't have token IDs 2024-02-07 20:10:49 +00:00
Icaro Motta b727f1e14b Extract entire permissioned balances logic to separate file 2024-02-07 20:10:49 +00:00
Icaro Motta 105703e2eb Remove zombie code from experiments 2024-02-07 20:10:49 +00:00
Icaro Motta 4f8a66fc07 Create endpoint to get permissioned balances 2024-02-07 20:10:49 +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
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 ac81c15805 fix: ignore outdated COMMUNITY_SHARD_KEY messages
This mitigates issue where community shard on client's side was not in
sync with owner's.

relates to: status-im/status-desktop#13217
2024-01-29 18:21:51 +01:00