Giter Site home page Giter Site logo

rs-platform's People

Contributors

antouhou avatar fominok avatar iammadab avatar jawid-h avatar pastapastapasta avatar pauldelucia avatar qrayven avatar quantumexplorer avatar shumkov avatar strophy avatar thephez avatar tonykode avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rs-platform's Issues

Query failure/success dependent only on orderBy direction

Expected Behavior

Query would succeed or fail consistently regardless of orderBy direction (asc vs desc).

Current Behavior

The same query succeeds when the orderBy direction is desc and fails with the following error when the direction is asc:
InvalidRequestError: Invalid query: path_queries can only refer to items and references

Edit: Upon further testing, it appears that this affects both < and <= operators for the specified query. The issue did not present itself when using > or >= operators for this query.

Possible Solution

N/A

Steps to Reproduce (for bugs)

  1. Run the query below with orderBy: [['records.dashUniqueIdentityId', 'desc']],
  2. Get successful response
  3. Change to orderBy: [['records.dashUniqueIdentityId', 'asc']],
  4. Get InvalidRequestError error
client.platform.documents.get(
  'dpns.domain',
  {
    limit: 2,
    where: [
      ['records.dashUniqueIdentityId', '<=', 'FETe2GxdRsAUj8Qoy3tsr6J822aupG5VYtetoYBgXt5P'],
    ],
    orderBy: [['records.dashUniqueIdentityId', 'desc']],
  },
);

Context

Your Environment

  • Version used: Dash SDK v3.22.0-dev.8 or 14 (only versions tried)
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Krupnik devnet
  • Operating System and version (desktop, server, or mobile): Linux
  • Link to your project: Example here: https://replit.com/@thephez/Query-syntax-comparison#index.js

Query responds with a number of documents > limit

Expected Behavior

Query should not return more records than the limit

Current Behavior

In at least some situations it is possible to receive more than the expected limit of results. One case is demonstrated in the example below. The behavior is elicited simply by changing the orderBy direction. The same query responds correctly when the orderBy direction is asc and returns excess results when the direction is desc.

I only tried this with startAt, but presume it affects startAfter and possibly others.

Possible Solution

N/A, but possibly related to #83 which also shows up depending on orderBy. But really no idea ๐Ÿคทโ€โ™‚๏ธ ๐Ÿ™‚

Steps to Reproduce (for bugs)

  1. Run the query below with orderBy: [['normalizedLabel', 'asc']],
  2. Get successful response limited to 1 document
  3. Change to orderBy: [['normalizedLabel', 'desc']],
  4. Get incorrect response containing (atm) 13 documents
client.platform.documents.get(
    'dpns.domain',
    {
      limit: 1,
      startAt: Buffer.from(Identifier.from('4Qp3menV9QjE92hc3BzkUCusAmHLxh1AU6gsVsPF4L2q')),
      where: [
        ['normalizedParentDomainName', '==', 'dash'],
        ['normalizedLabel', 'startsWith', 'RT-'.toLowerCase()],
      ],
      orderBy: [['normalizedLabel', 'asc']],
    },
  )

Context

Your Environment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.