-
Notifications
You must be signed in to change notification settings - Fork 53
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
Cached task dependencies not retrievable #125
Comments
Note: Same issue exists with tags, and probably other things. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: