Asana / ruby-asana

Official Ruby client library for the Asana API v1
MIT License
77 stars 54 forks source link

getTasks Pagination Bug #149

Closed ickarakurt closed 1 year ago

ickarakurt commented 1 year ago

I am getting the below pagination error with this client

'''Asana::Errors::InvalidRequest: The result is too large. You should use pagination (may require specifying a workspace)'''

and I have tried to use pagination solutions in the documentation.

     tasks = @client.tasks.get_tasks(
      modified_since: five_years_ago,
      workspace: id,
      assignee: 'me',
      options: {
        pretty: true,
        fields: %w[gid name completed
                   completed_at created_at due_at due_on notes start_on],
        offset: 0,
        limit: 50,
      },
    )

But could not solve the issue. Could anyone help me? I don't know what I am doing wrong. Is this a bug or my mistake?

igor-alexandrov commented 1 year ago

Hi @ickarakurt is this still relevant? I just tried to make the same request and seems like everything is fine.

tasks = client.tasks.get_tasks(
  workspace: 'workspace_id',
  assignee: 'me',
  modified_since: 5.years.ago.to_date,
  options: {
    pretty: true,
    fields: %w[gid name completed completed_at created_at due_at due_on notes start_on],
    offset: 0,
    limit: 50
  }
)

=> #<Asana::Collection<Asana::Resources::Task> [#<Asana::Task gid:...
ickarakurt commented 1 year ago

Hi @ickarakurt is this still relevant? I just tried to make the same request and seems like everything is fine.

tasks = client.tasks.get_tasks(
  workspace: 'workspace_id',
  assignee: 'me',
  modified_since: 5.years.ago.to_date,
  options: {
    pretty: true,
    fields: %w[gid name completed completed_at created_at due_at due_on notes start_on],
    offset: 0,
    limit: 50
  }
)

=> #<Asana::Collection<Asana::Resources::Task> [#<Asana::Task gid:...

@igor-alexandrov thanks for trying. In the last 30 days, we did not get this error again. I don't know what changed, but I am closing this issue.