/services/ API does offset/length calculation wrong

Bug #974431 reported by Daniel Holbach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
harvest
Fix Released
High
Daniel Holbach

Bug Description

The code is currently written like this:

    offset = parse_number_argument(extra_arguments, '_offset')
    length = parse_number_argument(extra_arguments, '_length')
    if not length or length > CHUNK_SIZE:
        length = CHUNK_SIZE
    results = model.objects.filter(**search_values)[offset:length]

This means that we will never be able to get more objects with an id> CHUNK_SIZE.

Tags: api

Related branches

Revision history for this message
Daniel Holbach (dholbach) wrote :

Won't get around to this until next week. If anyone wants to work on this, please go ahead.

It will be good to fix this, so we can have interesting clients talking to Harvest, ie. a dev opportunities lens for Unity. ;-)

Changed in harvest:
assignee: Daniel Holbach (dholbach) → nobody
Changed in harvest:
assignee: nobody → Daniel Holbach (dholbach)
status: Triaged → In Progress
Changed in harvest:
milestone: none → 0.2.14
status: In Progress → Fix Committed
Changed in harvest:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.