Hello Asana Support Team,
We are facing an issue with the Search API where results are not always strictly ordered by modified_at, which breaks pagination logic and can cause items to be skipped.
We are using the following endpoint:
GET /workspaces/{workspace_gid}/tasks/search
with parameters like:
-
portfolios.any -
modified_at.after -
sort_by=modified_at -
limit -
opt_fields -
is_subtask=false
This returns paginated results sorted by modified_at, and we use the modified_at.before value from the last item of each page to fetch the next page.
However, in some responses, items near the page boundary are not strictly sorted by modified_at. For example, two items that should be ordered by modified_at appear out of order, where the item with the later modified_at appears after the one with the earlier modified_at.
With pagination enabled, this causes a scenario where using modified_at.before for the next page can exclude items that should have appeared, resulting in missing items.
We understand that Asana recommends using created_at for stable pagination, but our use case requires sorting by modified_at for performance.
Could you please confirm:
-
Is the Search API guaranteed to return results strictly ordered by
modified_atwhen usingsort_by=modified_at? -
If not, what is the recommended safe way to paginate when using
modified_at? -
Is this a known issue or something that can be addressed at the API level?
Similar ticket in the past for the same issue: Question about search api + paging
Thanks!