Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to join a community is not canceled after cancellation #21961

Open
VolodLytvynenko opened this issue Jan 20, 2025 · 4 comments · May be fixed by #22183
Open

Request to join a community is not canceled after cancellation #21961

VolodLytvynenko opened this issue Jan 20, 2025 · 4 comments · May be fixed by #22183

Comments

@VolodLytvynenko
Copy link
Contributor

Steps to reproduce:

  1. Navigate to the Discover page.
  2. Send a request to join a community.
  3. Attempt to cancel the request.

Actual result:

The request is not canceled, and the community remains in the "pending" state.

cancel_com.mp4

Expected result:

The request should be successfully canceled, and the community should no longer appear in the "pending" state.

Logs:

https://drive.google.com/file/d/1eC9KKtV4Em_2W4nW6ZWluhU2pIfkYB6r/view?usp=drive_link

ENV:

Nightly 20 Jan, 2025

@ulisesmac
Copy link
Contributor

ulisesmac commented Feb 6, 2025

Just to provide more context on this for anyone interested.

If the user logs out and logs in, the request to join is successfully cancelled, and the error thrown is:

failed to cancel request to join community <community-id> {:code -32000,
 :message
 "setting identity, skip-encryption or personal topic and datasync not supported"}

@osmaczko
Copy link

osmaczko commented Feb 6, 2025

The issue is indeed in status-go, i.e. when sending message to privileged members https://github.com/status-im/status-go/blob/0526d1878a77799e1c71d63d4b34a04c8f185bc0/protocol/messenger_communities.go#L1917.

@osmaczko
Copy link

osmaczko commented Feb 6, 2025

The fix is:

diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go
index 5796caf0d..89cb3ca6c 100644
--- a/protocol/messenger_communities.go
+++ b/protocol/messenger_communities.go
@@ -1914,6 +1914,7 @@ func (m *Messenger) CancelRequestToJoinCommunity(ctx context.Context, request *r
         }
 
         for _, privilegedMember := range privMembersArray {
+            rawMessage.Sender = nil
             _, err := m.sender.SendPrivate(context.Background(), privilegedMember, &rawMessage)
             if err != nil {
                 return nil, err

@ulisesmac
Copy link
Contributor

@VolodLytvynenko The solution is on the status-side, but I opened a PR on mobile that integrates the solution so that it can be tested:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

3 participants