Skip to content

Fix BioRecipientState equals to compare against its own type - #15038

Open
Andrea-Bruno wants to merge 2 commits into
signalapp:mainfrom
Andrea-Bruno:fix/bio-recipient-state-equals
Open

Andrea-Bruno wants to merge 2 commits into
signalapp:mainfrom
Andrea-Bruno:fix/bio-recipient-state-equals

Conversation

@Andrea-Bruno

Copy link
Copy Markdown

BioRecipientState is a small wrapper around a Recipient that holds the profile row data for the settings screen. Its equals method checked whether the object being compared was a Recipient. But the class itself is a BioRecipientState, not a Recipient, so two BioRecipientState objects were never equal to each other, even when they wrapped a recipient with identical content.

Because of this, every time the underlying recipient data was re-emitted, the settings screen saw the profile row as changed and refreshed it, even when nothing about the profile had actually changed.

The fix compares against BioRecipientState and then compares the wrapped recipients by their content. The hashCode stays consistent with this, because two recipients that have the same content also have the same id, which is what the hash is built from.

Andrea-Bruno and others added 2 commits August 29, 2026 10:20
Corrected the callback in NotificationsSettingsFragment to use setMessageNotificationVibration instead of setMessageNotificationsEnabled when toggling vibration setting. This ensures that disabling vibration doesn't turn off notifications entirely.

@mtang-signal mtang-signal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, I like the change, but could you rebase this to remove the older commit (to fix message vibration)?

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.

2 participants