platform icon indicating copy to clipboard operation
platform copied to clipboard

query using `in` operator throws `Identifier expects Buffer`

Open dashameter opened this issue 3 years ago • 4 comments

Using an array of buffer identity Ids:

ownerIds :>>  (5) [Uint8Array(32), Uint8Array(32), Uint8Array(32), Uint8Array(32), Uint8Array(32)]

And a query using the in operator according to https://dashplatform.readme.io/docs/reference-query-syntax#operator-examples

        {
          where: [["$ownerId", "in", ownerIds]],
        }

throws:

Uncaught (in promise) IdentifierError: Identifier expects Buffer
    at new Identifier (webpack-internal:///./node_modules/@dashevo/dpp/lib/identifier/Identifier.js:18:11)
    at Function.from (webpack-internal:///./node_modules/@dashevo/dpp/lib/identifier/Identifier.js:106:10)
    at convertIdentifierProperties (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:93:55)
    at eval (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:130:88)
    at Array.map (<anonymous>)
    at Platform.eval (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:130:49)
    at step (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:33:23)
    at Object.eval [as next] (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:14:53)
    at fulfilled (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:5:58)
IdentifierError @ IdentifierError.js?93a2:12
Identifier @ Identifier.js?3e2b:18
from @ Identifier.js?3e2b:106
convertIdentifierProperties @ get.js?ae15:93

Same happens for an Array of String identityIds.

see: https://discord.com/channels/670271785974890526/718217459144065045/847055564805767178 and https://discord.com/channels/670271785974890526/670599939528851476/937918648717303838

dashameter avatar Feb 01 '22 10:02 dashameter

is this still an issue? the query syntax reference got updated lately https://dashplatform.readme.io/docs/reference-query-syntax#operator-examples

dash-maverick avatar Mar 31 '22 16:03 dash-maverick

please try a retest considering new updated in the docs for v0.22

dash-maverick avatar Apr 01 '22 07:04 dash-maverick

IIRC this was a platform bug, not an issue with the actual query. I doubt the updated docs will have changed anything, but perhaps the underlying issue was fixed also.

thephez avatar Apr 04 '22 11:04 thephez

Hey, may be related to https://github.com/dashevo/platform/issues/315 . Please check your index definitions

dash-maverick avatar Apr 06 '22 12:04 dash-maverick

It fixed

shumkov avatar Sep 26 '24 18:09 shumkov