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

[FR] Auth: Provide an API to create/update users without unneeded API requests #1885

Open
brettwillis opened this issue Aug 22, 2022 · 3 comments · May be fixed by #2104
Open

[FR] Auth: Provide an API to create/update users without unneeded API requests #1885

brettwillis opened this issue Aug 22, 2022 · 3 comments · May be fixed by #2104

Comments

@brettwillis
Copy link

The updateUser() and createUser() methods always perform two API requests under the hood: (1) the create/update request, and (2) a subsequent getUser() request.

In latency-sensitive applications where the result of getUser() is not required, this means an extra un-needed sequential round-trip network request. This fact is not apparent from the API or documentation.

Proposal

Add a second, optional parameter to createUser() and updateUser() called something like noFetchUserRecord which defaults to false (existing behaviour). If true, the getUser() request will be skipped, and the function will return Promise<void>, avoiding the un-needed round-trip request.

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@brettwillis
Copy link
Author

@lahirumaramba @prameshj I noticed you added the "help wanted" label. I'm more than happy to submit a PR for this, however we need to align on the proposal first. What are your thoughts?

@brettwillis
Copy link
Author

@lahirumaramba @prameshj didn't get a response so assuming that you were ok with my original proposal? I have drafted the PR accordingly, along with tests etc, it would be great if you can take a moment to check it 🙏🏼 .

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

Successfully merging a pull request may close this issue.

4 participants