Cursor re-use for orders created within 2-seconds of each other

Hello,

I just noticed two orders sharing the same cursor values despite being created within 20 minutes of each other. Request ID for the newer order: 63ba42538c9506f319625213, Request ID for the older order: 63ba43816eab38ba9854aaa2

This creates a big constraint to query data. So far we had been querying data for 6-hour time intervals, and relying on using the cursor to determine where to pick up once the process restarts. However, if we are seeing cursors being reused within 20 minutes of each other, there is a bigger constraint created with unnecessary complications required to just ensure that all orders are being picked up completely.

Is there a way to estimate how frequently cursor values will be re-used? Or are they updated frequently? Is that why I am seeing the same cursor values within the same time interval? I don’t want it to be the case where if the order volume increases, we’d start seeing the same cursor value show up within 5-minute time intervals, when we have programmed it to check every 10-minutes…

This is how our queries are structured:

orders(fulfillment_status:"{fulfillment_status}" order_date_from:"{start_date}" order_date_to:"{start_date_plus_6_hours}") {{
          request_id
          complexity
          data (first:10  after:"{cursor_of_last_order_pulled}")

EDIT: I am actually seeing it be used within 2 second intervals as well…
Request IDs: 63ba5753178b6f45b30fcf00, 63ba579c5ff0f3b0d68f8edb

Hey @saladass4254,

Thanks for reaching out!
Just wanted to let you know we’re looking into this issue now.

Best,
RayanP

Hey @saladass4254,

Thanks for hanging in there.

It turns out that this behavior is expected. We do not have a cursor for every unique object in the API. The cursor id is dependent on the order of objects returned by a query.

For example comparing a shipments query and an orders query with the same set of filters (first:10), the cursors will be matching. The first objects returned in each query would share the same cursor. This would also work in the case of comparing two orders queries with the same set of filters, which is what you’re experiencing.

Let me know if anything needs any clarification or if there’s anything I can do to assist here!

Best,
RayanP