Skip to content

Bug: A valid free-form contact address can crash the contact details dialog #3625

Closed

Description

@yannickmonney

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

An API-imported address can make the contact details unreadable for every teammate who opens it, including the other valid contact fields.

Reproduction:

  1. Create a contact through the API with name/email and address {"street":{"line1":"One Test Street"},"country":"Switzerland"}.
  2. Read it back: the API accepts and preserves that free-form bounded object.
  3. Open its contact details dialog.

Expected: Every accepted address shape can be viewed safely. Render supported scalar fields or a safe fallback; valid stored JSON must not crash the dialog.

Observed: ContactViewDialog renders address.street directly as a React child. The nested object throws "Objects are not valid as a React child (found: object with keys {line1})" and the details body is replaced by Something went wrong / Try again.

Cause: The documented schema accepts address as a bounded free-form object, but the client contract narrows fields to strings without runtime validation. The renderer trusts that narrower type.

Frozen observation/control output:

CONTACT_ADDRESS {"httpStatus":200,"readback":{"street":{"line1":"One Test Street"},"country":"Switzerland"}}
CONTACT_ADDRESS_CRASH {"error":"Objects are not valid as a React child (found: object with keys {line1})","rendered":"Contact details…Something went wrong. Try again."}
CONTACT_ADDRESS_CONTROL {"street":"One Test Street","rendered":true}

Control: The same ContactViewDialog renders a flat string street and country correctly. The nested fixture passed the running local app API and readback without coercion.

Exact component probe command:

/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 /Users/yannick/.codex/notes/tale-100-findings/commerce-proof/boundaries.probe.test.tsx --maxWorkers 2 --reporter verbose --silent=false

HTTP readback command: python3 /Users/yannick/.codex/notes/tale-100-findings/commerce-proof/boundary-api-probe.py. Component probes passed 3/3; HTTP assertions passed. Scratch tests remain outside the checkout.

Proof boundary: Actual ContactViewDialog, EntityViewDialog and error boundary executed in jsdom over a row passed through the real pagination adapter. HTTP fixture came from the local PostgreSQL-backed API. No production testing or browser layout claim. A harmless async locale effect emitted an act warning after the assertion; the observed React child error and successful flat control are explicit.

Source:

Deduplication: All-state contact address crash returned no matches; cached contact titles reviewed. This concerns supported address JSON reaching rendering, not malformed import parsing.

Acceptance: Cover the triggering boundary with a regression test, enforce the expected behavior, and retain the passing control.

Parent verification: independently reran the observation/control proof successfully; retained output: commerce-proof/parent-boundaries.log. Live all-state feature searches and related historical reports were reviewed before filing.

Activity

  1. added 3 commits that reference this issue on Oct 9, 2026
    e23bee5
    8b4f8ce
    c845d50
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

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions