Tag endpoint not handling paginated request and timeout properly?

Hi :wave:,

I have been using the API for a long time now, and did not have issues with pagination or timeouts for a while. But for one of my services, the server gives me a timeout on the seconde request.

Here is the code:

this.asanaTagService.getAllForWorkspaceOrOrg(this.organizationId)
        .then((collection: any) => {
          collection.stream().on('data', t => {
            [...]
          })
        });

The service getAllForWorkspaceOrOrg is as follows:

const client = this.asanaConnectService.getClient();
    const opt_fields = 'name,color,created_at';
    return client.tags.findAll({workspace: organizationId, opt_fields});

First paginated request works as expected, but often the second request fails with Server timed out with your request. Try paginating if you aren't already doing so. Because I am using the NodeJS library with a stream operator, I expected the rate limit and pagination to be taken care of… Am I missing something here?

Here is a screenshot of the request in Chrome.

41

cc @Joe_Trollo @Phil_Seeman

1 Like

Yeah, it sure looks to me like they are being handled within the library. I think @Joe_Trollo or team member will have to weigh in…

1 Like

And the library is working perfectly for custom fields, tasks or projects, but I am hitting a wall with tags…

Our client libraries will automatically retry on 429 Too Many Requests responses, but won’t retry on 500 errors because it’s not certain that retrying is safe (such as when creating new tasks). We have a task in our backlog to retry on some 500s for GET requests, but haven’t been able to prioritize it.

Tags are also notoriously expensive to fetch because of their complicated access control rules. Workspaces with lots and lots of tags will frequently cause timeouts, and there’s not much we can do. The two main options are:

  1. DM me the workspace ID and I can determine if there are lots of tags in that workspace. If there are, you can reach out to the customer to let them know the issue and then have them contact us directly to request that we clean up inaccessible tags.
  2. Wait until we ship improvements to how our internal filtering works. We’re currently working on pushing more filtering to be further down in our stack, closer to our databases, which should improve performance in situations like this.
1 Like