Skip to content

Bug: Clearing a contact phone reports success but keeps the old number #3614

Closed

Description

@yannickmonney

P2 · Reproduced locally against 44e0dcf254975286c0e9dea443b5cd1ca6b23347. No production testing.

A person cannot remove an obsolete or unwanted phone through the contact editor and receives a false successful-save confirmation.

Reproduction:

  1. Create a contact with an email and Phone +41 44 555 0100.
  2. Open its row menu → Edit, clear Phone, and choose Save.
  3. Reopen the record or reload Contacts.

Expected: The phone is empty after the successful save.

Observed: The dialog submits phone: "", shows its success toast, and closes. The app API answers { "ok": true }, but GET returns the previous phone unchanged.

Cause: The shared input schema preprocesses a blank phone to undefined, which the real update service interprets as unchanged. The editor intentionally sends the empty string for clearing; its unit test stops at the mutation mock and misses the server normalization.

Frozen observation/control output:

CONTACT_PHONE_CLEAR {"write":{"phone":""},"response":{"ok":true},"readbackPhone":"+41 44 555 0100"}
CONTACT_PHONE_CONTROL {"write":{"phone":null},"readbackPhone":null}

Control: The same owned contact clears when the API body is { "phone": null }. Replacing its phone also succeeds.

Verification command (audit scratch files are outside the source checkout):

/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x vitest run --config /Users/yannick/.codex/notes/tale-100-findings/commerce-proof/vitest.config.ts --maxWorkers 2 --reporter verbose --silent=false

The real HTTP readback checks use python3 /Users/yannick/.codex/notes/tale-100-findings/commerce-proof/api-probe.py; all writes were to six named Commerce audit fixtures retained on the isolated local stack.

Proof boundary: Actual ContactEditDialog, adapter, and shared schema executed in jsdom; the exact clear body and null control were independently sent to the local running app API and read back from its real PostgreSQL database. No production testing or browser end-to-end claim.

Source:

Deduplication: All-state searches contact phone and cached issue titles reviewed. Closed #2640 concerns required Name/inline validation; this is the later app-door blank-phone preprocessing path, independently confirmed by HTTP readback.

Acceptance: Add a regression across the failing boundary, preserve the successful control, and verify the corrected UI/request/readback behavior.

Parent verification: independently reran the frozen component suite successfully; retained output: commerce-proof/parent-components-confirmed.log. Live all-state issue titles and relevant older reports were reviewed before filing.

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. tale-code-bot commented on Oct 30, 2026

    @tale-code-bot
    Collaborator

    Already done on main, so the Development board's task for this issue (TALE-24) is cancelled and the issue closed as completed.

    Evidence:

    • Commit e3943c5f5c1e69c39309bb8f5b9cf5e63ce41672 ("fix(platform): close the app-door refusal round-two review findings", 2026-09-28) changed the contact edit dialog. It now sends a cleared phone as the explicit null the app door clears on, instead of the blank string the door reads as "not sent".
    • On main b2560c2d7d3294993e66129c891be4a059f3d6c4, services/platform/app/features/contacts/components/contact-edit-dialog.tsx:89 reads phone: data.phone.trim() || null.
    • The regression test contact-edit-dialog.test.tsx ("clears an existing phone number instead of silently keeping it") asserts that the request carries phone: null.

    If something is still missing, reopen this issue and say what.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions