Skip to content

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

Closed

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
  2. rfgamaral commented on Nov 18, 2026

    @rfgamaral
    Member

    @nolan-warner thanks for the detailed report. This was already fixed in @todoist/comms-cli 5.0.3, which shipped about an hour before this issue was opened 😅

    • @todoist/comms-sdk 5.2.2 accepts a status with message: null (todoist/comms-sdk-typescript#153, #154).
    • #122 moved the CLI to that SDK version and changed tdc status and tdc user to show an emoji-only status as just the emoji.
    • #123, in 5.1.0, also lets you set one: tdc status set --emoji 🤒.

    Run tdc update to get 5.0.3 or later, and tdc thread view should work again. I'm closing this, but please reopen it if you still see the error on the latest version.

  3. nolan-warner commented on Nov 19, 2026

    @nolan-warner
    Author

    Oof... I did an update and tested it, but I guess there was a lag between when I did the update and when I filed the report!. I've updated and it's working now. Thanks!

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