-
Notifications
You must be signed in to change notification settings - Fork 927
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
The org-users command gets user guid data multiple times #45
Comments
Hi @sykesm - do you have a script and fixtures to reproduce? This is going into CLI icebox, and it'll be easier to get to if we can get it repro'd quickly. cc: @scottruitt |
@thansmann and @sykesm -- @tedsuo and I reviewed it. It's a legit issue, but one we probably won't tackle immediately. I'll prioritize this in the backlog. Scott |
It is undesirable to make unnecessary HTTP requests to product a single set of data. That truth should be self-evident. Unfortunately, due to the nature of the CC API, we made the explicit choice to make requests for resources with The short answer is that doing this helps us know (at compile time) that we're using the API correctly. A longer answer would probably address that this is a hack but that it's a useful hack that makes our code (and api) less complex and thus easier to reason about. Feel free to continue commenting on this issue if you'd like to discuss it. It is unlikely that we would drastically change our internal API model (barring some features or new API that drove out these changes), so we'd like to consider this as closed. |
@XenoPhex the next time I'm in SF (end of the month) I'd welcome a discussion around inline-relations-depth=n. There are a number of scenarios where it makes a great deal of sense - even here. That said, it doesn't make make a lot of sense to me to get the data a second time when when you know you got it the first time. |
OMG! I won! :) |
- they are no longer necessary as the formulas have been removed from said taps
- they are no longer necessary as the formulas have been removed from said taps
When the
org-users
command runs, it gets the organization guid by callingFindByName
on the organization repository. The currentFindByName
code is usinginline-releations-depth=1
which, in addition to returning the org guid, returns all of the users, managers, billing managers, and auditors.The user information from the initial request is discarded and then additional requests are made to get the user guids by querying the managers, billing managers, and auditors endpoints. For large organizations, this results in a significant amount of wasted data retrieval and DB queries.
It seems like the initial org query shouldn't be using
inline-relations-depth=1
for this path and it probably makes sense to review other paths as well.The text was updated successfully, but these errors were encountered: