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: handle connection requests with deleted users [WPB-4356] #16815

Merged
merged 8 commits into from
Feb 13, 2024

Conversation

PatrykBuniX
Copy link
Contributor

@PatrykBuniX PatrykBuniX commented Feb 12, 2024

BugWPB-4356 Web/Desktop - Connection request from a deleted profile cannot be removed/ignored

Description

  • filter out connection requests with deleted users - connection request is a conversation of type 3 (CONNECT)
  • delete outgoing connection request when trying to cancel it and it fails because of the other user being deleted.
  • delete incoming connection request when trying to accept/ignore it if the other user is deleted

Checklist

  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (a8ef661) 45.85% compared to head (6866eab) 45.86%.
Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #16815      +/-   ##
==========================================
+ Coverage   45.85%   45.86%   +0.01%     
==========================================
  Files         746      747       +1     
  Lines       24440    24501      +61     
  Branches     5578     5594      +16     
==========================================
+ Hits        11207    11238      +31     
- Misses      11815    11839      +24     
- Partials     1418     1424       +6     

@PatrykBuniX PatrykBuniX marked this pull request as ready for review February 13, 2024 08:43
@PatrykBuniX PatrykBuniX changed the title runfix: filter out connection requests with deleted users [WPB-4356] runfix: handle connection requests with deleted users [WPB-4356] Feb 13, 2024
@PatrykBuniX PatrykBuniX changed the title runfix: handle connection requests with deleted users [WPB-4356] fix: handle connection requests with deleted users [WPB-4356] Feb 13, 2024
@@ -52,6 +52,7 @@ export class ConnectionRepository {
private readonly connectionService: ConnectionService;
private readonly userRepository: UserRepository;
private readonly logger: Logger;
private deleteConnectionRequestConversation?: (userId: QualifiedId) => Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably find a naming that suggest it's a callback (here we feel it's going to trigger an imperative action)

@PatrykBuniX PatrykBuniX merged commit f120a5e into dev Feb 13, 2024
11 checks passed
@PatrykBuniX PatrykBuniX deleted the runfix/WPB-4356-deleted-profile-connection-req branch February 13, 2024 11:30
atomrc pushed a commit that referenced this pull request Feb 14, 2024
* runfix: filter out connection requests with deleted users

* test: fix tests

* runfix: handle canceling a connection req with deleted user

* test: fix test

* runfix: handle incoming request case

* test: add scenario for deleting local req when loading conversations

* test: add scenario for trying to accept/ignore incoming req

* refactor: improve callback naming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants