Skip to content

Search for Data Contract Documents partially not working #2409

@owl352

Description

@owl352

When trying to retrieve documents for contract date withdrawals with where, I get an empty array, also sort works only in asc order, desc not working

Expected Behavior

If I specify ['transactionIndex', '==', 2] or ['transactionIndex', '>=', 2] or ['transactionIndex', '>', 2], then I should get an array with documents whose index matches the condition in the response

Current Behavior

At any specified value for transactionIndex, I get an empty array in response. Also, if you specify another condition for status as a range, the search will also return an empty array. However, if at least one condition requires a strict comparison, everything will work

Possible Solution

Steps to Reproduce (for bugs)

  1. use this json for data contract object
  2. Here you get empty response
const query = {
  where: [
    ['transactionIndex', 'in', [0,1,2,3,4,5]],
    ['status', '>', 0]
  ],
  orderBy: [
    ['status', order],
    ['transactionIndex', order],
  ]
}

const { documents } = await this.dapi.platform.getDocuments(Identifier.from(dataContractObject.id), type, query) 
  1. Here you get some documents
const query = {
  where: [
    ['transactionIndex', 'in', [0,1,2,3,4,5]],
    ['status', '=', 3]
  ],
  orderBy: [
    ['status', order],
    ['transactionIndex', order],
  ]
}

const { documents } = await this.dapi.platform.getDocuments(Identifier.from(dataContractObject.id), type, query) 

Context

Your Environment

  • 'dashpay/drive:1.7'
  • 'dashpay/dapi:1.7.1'
  • node: v20.16.0
  • dapi-client: from fork which made already after the latest updates of the getDocuments method

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions