Add name quality tracking to prevent display name flip-flopping#885
Add name quality tracking to prevent display name flip-flopping#885jlxq0 wants to merge 4 commits intomautrix:mainfrom
Conversation
|
Hmm, I'm not sure you want to put PushName above Phone number in priorities. That effectively results in PushName never being used in most scenarios, doesn't it? Personally I'd rather like to have PushNames when available, since most of my contacts have at least their first name in the profile, while I hardly know their mobile phone numbers from memory. |
|
Fair point. The flip-flopping I was trying to fix was mainly FullName ↔ PushName oscillation (e.g., "John Smith" vs "John"), not PushName vs phone number. I could try to make two changes:
That way the default behavior stays unchanged, and users experiencing flip-flopping can opt-in with their preferred hierarchy. Would that work better? |
|
Sounds like a good idea to me. But let's see what @tulir thinks of this pull request first. |
Track the "quality" of display name sources to prevent lower-quality names from overwriting higher-quality ones. This fixes the issue where contacts constantly flip between different name formats when WhatsApp events contain different subsets of contact data. Quality hierarchy (highest to lowest): - FullName (contact list name) - most stable, user-preferred - BusinessName (WhatsApp Business account name) - stable - Phone number - stable fallback - PushName (user's self-set name) - can change frequently Also prevents updating to empty names entirely. Inspired by the similar contact_list_names implementation in mautrix-signal.
Builds + pushes ghcr.io/jlxq0/mautrix-whatsapp on every push to name-quality-tracking. Tags: :name-quality - rolling pointer :sha-<short> - immutable per commit :v<upstream>-name-quality - immutable, encodes upstream version Eliminates the manual build step that was needed for bumps.
50167a3 to
4c05196
Compare
Track the "quality" of display name sources to prevent lower-quality names from overwriting higher-quality ones. This fixes the issue where contacts constantly flip between different name formats when WhatsApp events contain different subsets of contact data.
Quality hierarchy (highest to lowest):
Also prevents updating to empty names entirely.
Inspired by the similar contact_list_names implementation in mautrix-signal.
Tested in my production.