Closed cmolina closed 2 years ago
Hello, I haven't heard back from you, and I like to know if there is anything I can do to get this merged soon. Thanks, Carlos
Hi @cmolina,
Sorry for the delay answering and thanks a lot for your very well written PR. The bug you point out is indeed there, and the solution you propose looks good to me!
We still have parts of the apps uncovered by tests (of course more than what we would like; we're working on improving the test coverage), and the contact widget is one of them. We haven't fully decided yet whether to go for end-to-end or integration tests for a thing like this one. We would also like to refactor the contact data structure, but again we still haven't had time to address that. So it's easier if we leave the tests out for the moment.
I'll let you know when your PR is merged!
Hi @econdepe, sounds great!
Merged in https://github.com/ProtonMail/WebClients/commit/75fa13d994cf6c9110ba1a262c837c4d64ddeb93 ;) Thanks again for the PR! :pray:
Hello! This is my first PR to an open-source project :)
The purpose of this change is to address a bug that appears in ProtonMail in the merging contacts preview component, showing the emails with the wrong group (or
label
as appears in the code).In my personal email I have 2 contacts called "Banco de Chile":
Expected behavior
When viewing the merging contacts preview, I should see each email with their corresponding label.
Current behavior
When viewing the merging contacts preview, I see each email with the wrong label, or no label at all.
This is misleading, and made me believe I should not merge my contacts since I would lose information.
What is included in this CR
I realized that
ContactView
component is the one responsible for displaying a contact; and that this component is used 3 times across the codebase; however, in order to work correctly, it needs to receive a list with thecontactEmails
for obtaining the corresponding labels.I replaced the
contactEmails
, which was initialized as a list with all the emails of every contact, to only have the emails from the contacts being merged.How I tested this
Manually. I looked for unit tests, but I couldn't find any. If anyone is interested pairing with me, I'd be happy to learn how to add a new unit test for this feature.
I confirm the merge happen successfully; however the original contacts were not deleted. After this change gets approved, I would like to address that different issue in a separated PR (#261).