Skip to content

getComment returns reactions object with an empty string key instead of the emoji #307

@Flouse

Description

@Flouse

Bug description

When fetching a comment that has a reaction (e.g., ✅), the reactions field in the returned Comment object is not structured as expected. The key for the reaction is an empty string ('') instead of the emoji character itself ('✅').


Expected behaviour

The reactions object should be a dictionary where the keys are the string representation of the reaction emojis. For a "check mark" reaction from a user with ID 123456, the object should look like this:

{
  "✅": ["123456"]
}

Actual behavior

Instead, the key for the reaction is an empty string. The actual returned object looks like this:

{
  "": ["123456"]
}

Is reproducible

Yes

To reproduce

Steps to reproduce the behavior:

  1. In Todoist, create a task and add a comment to it.
  2. Add a reaction (e.g., the ✅ emoji) to that comment.
  3. Using @doist/todoist-api-typescript, fetch that comment using the api.getComment(commentId) method.
  4. Inspect the reactions property of the returned comment object.

This issue also appears when processing comment updates from the Sync API when notes is included in resource_types.

Screenshots

Image

Version information:

  • Package version: "@doist/todoist-api-typescript@^5.0.1"

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions