Skip to content

MistDemo web: add phone-number support to /users/discover #398

Closed

Description

@leogdion

Context

PR #396 wired the user-identity routes into the MistDemo web app. During review we removed the two Apple-deprecated lookup routes (/users/lookup/email, /users/lookup/id) from the web surface and routed all lookups through the supported POST /users/discover endpoint instead.

/users/discover currently forwards emails and user record names (both via UserIdentityLookupInfo). The underlying discoverUserIdentities(lookupInfos:) also accepts phone numbers (UserIdentityLookupInfo(phoneNumber:)), but the web demo doesn't expose them yet.

Task

Add phone-number support to the demo's discover panel:

  • Request DTO (WebRequests.DiscoverUsers): add a phoneNumbers: [String] field (decode with decodeIfPresent(...) ?? [], mirroring emails/userRecordNames).
  • WebBackend.webDiscoverUsers + CloudKitService conformance (CloudKitService+WebBackend+Users.swift): accept phoneNumbers and append phoneNumbers.map { UserIdentityLookupInfo(phoneNumber: $0) } to the combined lookup-info array.
  • Frontend (index.html + js/users.js): add a phone-numbers input to the Discover section; include phoneNumbers in the POST body and the CloudKit JS parity loop (discoverUserIdentityWithPhoneNumber).
  • Tests/mock: extend DiscoverUsersCall + usersDiscoverForwards to cover phone numbers.

References

Activity

  1. added 2 commits that reference this issue on May 26, 2026
  2. added this to the v1.0.0 milestone on May 26, 2026
  3. modified the milestones: v1.0.0, v1.0.0-beta.4 on Aug 20, 2026
  4. leogdion commented on Aug 20, 2026

    @leogdion
    MemberAuthor

    Verification caveat for #425

    The implementation follows this issue's spec exactly, and no Sources/MistKit/ change was needed — UserIdentityLookupInfo already had phoneNumber and a phoneNumber: init parameter, so the change is confined to Examples/MistDemo.

    One caveat worth recording: the phone-number path was verified only through the mock backend, not against live CloudKit. DiscoverUsersCall + usersDiscoverForwards confirm that phoneNumbers is decoded from the request body and forwarded into discoverUserIdentities(lookupInfos:) as UserIdentityLookupInfo(phoneNumber:) — that is, the plumbing is proven, but not that CloudKit accepts these values or what format it expects.

    Phone numbers are the likeliest of the three lookup kinds to have server-side format requirements (E.164 vs. national formatting, punctuation handling). If POST /users/discover is strict about that, the demo will forward whatever the user types and surface an opaque server error. Nothing in this change normalizes or validates the input.

    Not proposing a fix — normalization may well belong to the caller rather than the demo — but flagging it so a live test with a real, discoverable phone number happens before this is treated as a working demo path.

    🤖 Generated with Claude Code

  5. added 3 commits that reference this issue on Aug 21, 2026
    0804211
    cda1d11
    b47c779
  6. leogdion commented on Aug 28, 2026

    @leogdion
    MemberAuthor

    Resolved on v1.0.0-beta.4 via #425 (commit b47c779). Phone numbers now flow through the MistDemo web /api/users/discover path; no Sources/MistKit change was required.

  7. added 2 commits that reference this issue on Aug 29, 2026
    f1ab42f
    0375d09
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions