intercom / intercom-node

Node.js bindings for the Intercom API
https://developers.intercom.com
Other
362 stars 116 forks source link

Searching conversations with date fields always returns an empty result #381

Open sannana opened 10 months ago

sannana commented 10 months ago

Version info

Expected behavior

Searching conversations with date fields should return matching conversations

Actual behavior

The use of any date field, in any way, in conversations searc,h leads to an empty result

Steps to reproduce

  1. Try to search conversation, using any date field, for example:
try {
    const conversations = await client.conversations.search({
      data: {
        query: {
          'operator': Operators.AND,
          'value': [
            {
              'field': 'contact_ids',
              'operator': Operators.EQUALS,
              'value': userId
            },
            {
              'field': 'open',
              'operator': Operators.EQUALS,
              'value': true
            },
            {
              'field': 'created_at',
              'operator': Operators.LESS_THAN,
              'value': Date.now()
            },
          ]
        },
      },
    })
    return conversations
  } catch (error) {
    console.error('Error searching conversations:', error.message)
  }

Logs