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

fix: Clean up connections when user joins team (WPB-15263) #18579

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Conversation

thisisamir98
Copy link
Contributor

@thisisamir98 thisisamir98 commented Jan 13, 2025

BugWPB-15263 [Web] Cannot create 1:1 conversation with personal user that migrated to my team after cancelling connection request

Description

After the implementation of converting personal users to team users it turned out we need to clear any previous pending connection user A could possibly have with user B before user B joined user A's team.

in this PR we use user.update event to find out when a user has joined our team then:

If the user is our self user -> we delete all pending connections old previous - connections that are not accepted - with the new team members we find.

If the user is someone else -> we try to find if we have a pending old connection with them and delete it.

notes:

  • A pending connection is a connection that's not accepted. for already accepted connections we will use the existing connection to interact with the newly joined to our team user.

@thisisamir98 thisisamir98 requested review from otto-the-bot and a team as code owners January 13, 2025 10:48
@echoes-hq echoes-hq bot added the echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. label Jan 13, 2025
Copy link
Contributor

@przemvs przemvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 12.76596% with 41 lines in your changes missing coverage. Please review.

Project coverage is 46.11%. Comparing base (23f1db1) to head (70e60fd).
Report is 14 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #18579      +/-   ##
==========================================
- Coverage   46.14%   46.11%   -0.04%     
==========================================
  Files         870      875       +5     
  Lines       26801    26864      +63     
  Branches     6064     6077      +13     
==========================================
+ Hits        12368    12388      +20     
- Misses      12889    12929      +40     
- Partials     1544     1547       +3     

@thisisamir98 thisisamir98 changed the title fix: Clean up connections when user joins team (WPB-15263) fix: Clean up connections when user joins team [WPB-15263] Jan 13, 2025
@thisisamir98 thisisamir98 changed the title fix: Clean up connections when user joins team [WPB-15263] fix: Clean up connections when user joins team (WPB-15263) Jan 13, 2025
@thisisamir98 thisisamir98 merged commit 641bdf1 into dev Jan 13, 2025
20 of 22 checks passed
@thisisamir98 thisisamir98 deleted the WPB-15263 branch January 13, 2025 14:04
V-Gira pushed a commit that referenced this pull request Jan 14, 2025
* fix: Clean up connections when user joins team (WPB-15263)

* fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. 👕 size: M type: bug / fix 🐞
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants