Skip to content

fix: Duplicate groups makes contact crash - #5

Open
lforg37 wants to merge 7972 commits into
ProtonMail:mainfrom
lforg37:fix-duplicate-contact-group-crash
Open

fix: Duplicate groups makes contact crash#5
lforg37 wants to merge 7972 commits into
ProtonMail:mainfrom
lforg37:fix-duplicate-contact-group-crash

Conversation

@lforg37

@lforg37 lforg37 commented Feb 2, 2026

Copy link
Copy Markdown

When some contacts have duplicated groups for the same items, the rendering crashes.

Context, one of my contact has the following (anonymized) VCARD (exported from proton web ui):

BEGIN:VCARD
VERSION:4.0
FN;PREF=1:John Doe
FN;PREF=2:John Doe
TEL;PREF=1:+33666666666
TEL;PREF=2:+33999999999
TEL;PREF=3:+33 1 23 45 67 89
N:;;;;
UID:proton-android-3794338e-4fc7-426f-a6c1-8eabaa54e63f
ITEM1.EMAIL;TYPE=home;PREF=1:abcde@gmail.com
ITEM2.EMAIL;PREF=2:abcde@gmail.com
PRODID;VALUE=TEXT:-//ProtonMail//ProtonMail vCard 1.0.0//EN
ITEM1.CATEGORIES:Family
ITEM2.CATEGORIES:Family
ITEM1.CATEGORIES:Family
ITEM2.CATEGORIES:Family
END:VCARD

Trying to open the detail view for this contact makes the application crash with the following trace:

java.lang.IllegalArgumentException: Key "Family" was already used. If you are using LazyColumn/Row please make sure you provide a unique key for each item.
 at androidx.compose.ui.internal.a.a(Unknown Source:2)
 at androidx.compose.ui.layout.i0.s(Unknown Source:147)
 at ch.protonmail.android.mailcontact.presentation.contactdetails.ui.c.invoke(Unknown Source:332)
 ...
 ```
 
 A support case was open with ID 4403032 to this subject.

Niccolò Forlini and others added 30 commits December 12, 2025 13:23
 - Rust team confirmed that Mailbox holds a weak reference to its parent MailUserContext,
   meaning once the user session is destroyed (logout / session revoked), previously
   created Mailboxes become invalid/useless and reusing them can lead to unexpected
   internal errors.

 - Removed all mailbox caching from RustMailboxFactory (iOS does not cache Mailbox objects either)

 - Creating Mailbox is a cheap operation

ET-5576
NOJIRA
NOJIRA
 - This action was probably used in the past. Now it's not used
anymore. Scroll message id is obtained only during VM initialisation and
it's not possible to change it afterwards with a UI action.

ET-5569
    - Introduce ScrollToMessageState
    - Replace nullable scrollToMessage field in UI state with ScrollToMessageState
    - Add helper getScrollTargetMessageIdOrNull() for UI convenience

ET-5569
 - Handle MessagesData only when in NoScrollTarget
 - Compute scroll target index in reducer (previously it was in UI)
 - Ignore subsequent requests by keeping existing ScrollRequested/ScrollCompleted
   stable across MessagesData updates
 - Preserve completion by emitting ScrollCompleted(messageId) on ScrollRequestCompleted

ET-5569
…to-expand

 - Move scroll-to-index calculation out of Compose into reducer (targetMessageIndex)
 - Drive scroll+expand from ScrollRequested state:
      * hard scrollToItem(targetIndex)
      * expand target message
      * wait for final measuring then animate scroll to align header overlap
      * notify VM via onScrollRequestCompleted(targetId)

ET-5569
Problem: When long subjects are truncated, highlighting could style text that is
not actually visible. This produced colored artifacts near the “...” area.

- Measure the visible text end for truncated text
- Only highlight if a match is completely within visible part (last 3 letters
   of a match can be converted to Ellipsis later)

ET-5553
NOJIRA
Ensure that there is no blank screen displayed upon foregrounding and backgrounding the lock screen multiple times

ET-5518
ET-5518
Detekt 1.23.8 currently does not run due to this.

ET-5518
Niccolò Forlini and others added 25 commits January 28, 2026 09:56
NOJIRA
 - SwipeLifecycleState to define lifecycle of a swipe action
 - SwipeLifecycleEvent definitions for swipe lifecycle transitions
 - SwipeLifecycleReducer to drive state transitions

ET-5786
 - Refactor SwipeableItem to use SwipeLifecycleState instead of ad-hoc booleans
        - Add finger release detector to reliably detect finger release
        - Delay execution of swipe action until finger is released

ET-5786
Update Draft errors mapping with new branches introduced in this version.

NOJIRA
 - If the user changes his mind and swipes back below the threshold
   without lifting his finger, the action should not be performed
 - PointerReleased now returns Idle when not Armed (defensive cleanup).

ET-5786
Remove lottie and go for a native solution.

ET-5777
When some contacts have duplicated groups for the same items, the
rendering crashed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants