Skip to content

ZBUG-5250: Modern UI, contact cannot be saved when more than two same type addresses exist#798

Open
sumitTelus wants to merge 1 commit intomasterfrom
ZBUG-5250
Open

ZBUG-5250: Modern UI, contact cannot be saved when more than two same type addresses exist#798
sumitTelus wants to merge 1 commit intomasterfrom
ZBUG-5250

Conversation

@sumitTelus
Copy link
Contributor

@sumitTelus sumitTelus commented Jan 5, 2026

Problem

Modern UI not allowing to create a contact with more than two email addresses.

Issues:

  • Cannot add more than 2 emails in Modern UI
  • Contacts created in Classic UI with 3+ emails cannot be edited in Modern UI
  • Editing such contacts in Modern UI corrupts the data
  • Same limitation exists for phones, faxes, IMs, URLs, addresses, and dates

Root Cause

GraphQL schema only defined email and email2 fields in ContactAttrsInput. When Modern UI sent email3, GraphQL validation rejected it:

  • Field "email3" is not defined by type "ContactAttrsInput".
  • Classic UI works because it uses SOAP API directly, which supports unlimited fields.

Solution

Implemented hybrid normalization architecture:

Backend (api-js-client):

  • Updated schema: Multi-value fields now use arrays (email: [String])
  • Added ContactAttributeChange type for modify operations
  • Implemented conversion: GraphQL arrays ↔ SOAP individual fields

Frontend (zm-x-web):

  • Added normalization utilities in utils/contacts.js
  • Updated components to convert between arrays (GraphQL) and individual fields (UI)
  • Create sends full arrays, modify sends only changes as key-value pairs
  • Fixed notification handler to preserve all fields in cache

Data Flow:
UI: email, email2, email3

denormalize GraphQL: email: ["a", "b", "c"]

convert SOAP: email, email2, email3

normalize GraphQL: email: ["a", "b", "c"]

normalize UI: email, email2, email3

- Change contact schema to use arrays for multi-value fields
- Add ContactAttributeChange type for modify operations
- Update normalization logic to convert between SOAP and GraphQL formats
@sumitTelus sumitTelus changed the title ZBUG-5250: Support unlimited multi-value contact fields ZBUG-5250: Modern UI, contact cannot be saved when more than two same type addresses exist Jan 5, 2026
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.

1 participant