Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asana is not returning all tasks of a Project using API #243

Open
blamine81 opened this issue Aug 31, 2021 · 1 comment
Open

Asana is not returning all tasks of a Project using API #243

blamine81 opened this issue Aug 31, 2021 · 1 comment

Comments

@blamine81
Copy link

I'm developing an integration with Asana where I need to get all tasks of a Project.

Sometimes it works, and sometimes it doesn't return all the tasks and I don't get any error.

Here is a piece of code:

private async collectTasks( projectGid:string, offsetToken:string = '' ): Promise<void> {
 try {
  const params:any = {
   limit: 100,
   fields: 'name,assignee,assignee.email,due_on'
  }
  if(offsetToken)
   params.offset = offsetToken;
  
  const tasks = await this.createTokenClient().tasks.findByProject(projectGid, params);
  
  this.tasks = this.tasks.concat(tasks.data);
  
  if(
   tasks._response
   &&
   tasks._response.next_page
   &&
   tasks._response.next_page.offset
  ) {
   await this.collectTasks(projectGid, tasks._response.next_page.offset)
  } else {
   this.isAllTasksHere = true;
  }
 } catch (e) {
  console.log('ERROR WHEN GETTING TASKS', e.value);
 }
}
@blamine81
Copy link
Author

I m receiving this error (not all the time) :

{ Error: getaddrinfo ENOTFOUND app.asana.com app.asana.com:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'app.asana.com',
  host: 'app.asana.com',
  port: 443 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant