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

runfix: creation message not visible after accepting a connection #15987

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

PatrykBuniX
Copy link
Contributor

Description

Problem

This PR #15935 fixed an issue with sending a connection from one device when the other is online, but it also introduced new issue: Every time after connection event was received (with any status) we were mapping a connection to a conversation what appeared to happen to frequently.

When accepting a connection request, we're mapping a connection to a conversation, right after that we're displaying this conversation, see: https://github.com/wireapp/wire-webapp/blob/runfix/connection-accept-empty-conversation/src/script/components/ConnectRequests/ConnectionRequests.tsx#L93.

The problem is that .acceptConnectionRequest triggers connection mapping logic (via amplify), and before conversation is created and saved in a local state, we call .getOrCreate1to1Conversation again, creating a new conversation entity. Member message was loaded to the conversation entity that was not opened in the end, causing an empty conversation to be visible.

Solution

The solution is to simply reduce the cases when connection is being mapped to a conversation. We map a connection only when connection request is sent (to maintain the fix for a bug described above), or was previously sent and now is accepted (old behaviour).

Screenshots/Screencast (for UI changes)

Kapture 2023-10-12 at 09 52 29

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;

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #15987 (0fda8f1) into dev (e58060b) will increase coverage by 0.01%.
Report is 4 commits behind head on dev.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##              dev   #15987      +/-   ##
==========================================
+ Coverage   44.58%   44.60%   +0.01%     
==========================================
  Files         685      686       +1     
  Lines       22902    22911       +9     
  Branches     5201     5202       +1     
==========================================
+ Hits        10212    10220       +8     
- Misses      11373    11378       +5     
+ Partials     1317     1313       -4     

@PatrykBuniX PatrykBuniX merged commit 7b12d31 into dev Oct 12, 2023
@PatrykBuniX PatrykBuniX deleted the runfix/connection-accept-empty-conversation branch October 12, 2023 08:01
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.

4 participants