Skip to content

Commands that resolve user names crash when a workspace member has an emoji-only status #124

Open

Description

@nolan-warner

What happens

Any command that builds the user-name map fails with a Zod parse error once a workspace member has a status with an emoji but no text:

ZodError: [
  {
    "expected": "string",
    "code": "invalid_type",
    "path": ["status", "message"],
    "message": "Invalid input: expected string, received null"
  }
]
    at .../@todoist/comms-sdk/dist/esm/clients/workspace-users-client.js:43:63
    at async buildUserNameMap (.../@todoist/comms-cli/dist/lib/api.js:339:17)
    at async viewThread (.../@todoist/comms-cli/dist/commands/thread/view.js:104:32)

The command exits without output, so the whole thread or comment is unreadable, not just the one author's name.

Reproduce

  1. Have any member of the workspace set a status with only an emoji (no message). The apps allow this now.
  2. Run tdc thread view <any thread ref>, tdc view <comment URL>, or tdc comment view <ref>.

Seen on 2026-11-17 with @doist/comms-cli 4.2.0 and again after tdc update to @todoist/comms-cli 5.0.2 (@todoist/comms-sdk 5.0.1).

Not affected: tdc comment view <ref> --json and tdc search, which don't build the name map.

Cause

UserStatusSchema in comms-sdk (dist/esm/types/entities.js) declares message: z.string(). The backend returns message: null for an emoji-only status, so WorkspaceUserSchema.parse throws inside getWorkspaceUsers, and one user's status fails the whole list.

Suggested fix

  • In the SDK, make message nullable: message: z.string().nullable().optional(), and update any code that displays the status to handle a missing message (show the emoji alone).
  • Optionally, in the CLI, let buildUserNameMap survive a parse failure (for example, safeParse per user and fall back to the user ID) so a single malformed user can't take down unrelated commands.

Workaround until fixed

Read the content through the SDK directly, which skips the workspace-users call:

import { CommsApi } from '@todoist/comms-sdk'
const api = new CommsApi(token)
const thread = await api.threads.getThread(id)
const comments = await api.comments.getComments({ threadId: id })

Activity

  1. added
    bugSomething isn't working
    Severity:MediumBug affect core functionality, but there is a workaround
    on Nov 17, 2026
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

    Severity:MediumBug affect core functionality, but there is a workaroundbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions