You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When fetching a large number of tasks, one should be able to request fields like dependencies be pulled as part of the bulk pull. Those fields should be usable later without the information being refetched.
Second line does not cause extra HTTP GET on the API, as the dependency information was fetched with the original client.tasks.find_all() call.
Actual result:
Second line creates O(n) extra HTTP get requests.
Workaround
Users of the SDK can call task.instance_variable_get(:@dependencies) to check for cached dependencies instead of calling task.dependencies.
Commentary
This bug is causing 15% of the Asana API requests in my project. While the @Dependencies variable is saved upon the initial fetch from the project, it appears the generated API code for dependencies() does not look for @dependencies or save it afterwards:
When fetching a large number of tasks, one should be able to request fields like dependencies be pulled as part of the bulk pull. Those fields should be usable later without the information being refetched.
How to reproduce:
Expected result:
Second line does not cause extra HTTP GET on the API, as the dependency information was fetched with the original client.tasks.find_all() call.
Actual result:
Second line creates O(n) extra HTTP get requests.
Workaround
Users of the SDK can call
task.instance_variable_get(:@dependencies)
to check for cached dependencies instead of callingtask.dependencies
.Commentary
This bug is causing 15% of the Asana API requests in my project. While the @Dependencies variable is saved upon the initial fetch from the project, it appears the generated API code for dependencies() does not look for
@dependencies
or save it afterwards:https://github.com/Asana/ruby-asana/blob/master/lib/asana/resources/task.rb#L283-L286
The text was updated successfully, but these errors were encountered: