Multi-user support: only use current user token#9129
Conversation
fregante
left a comment
There was a problem hiding this comment.
Looks good to me from a first look, I like that it handles the POST calls automatically 👌
There are just a couple of nitpicks in the review comments
|
@SunsetTechuila feel free to merge when ready |
SunsetTechuila
left a comment
There was a problem hiding this comment.
I'm not sure why onetime should be used instead of mem, but it's not a big deal. LGTM
|
Without any parameters, mem is identical to onetime but slower. With parameters you're suggesting to extract 60% of the function's utility, placing the async getters outside the memoization. At any rate it would be weird to have such a specific assertion that is essentially |
We need two arguments for memoization: |
|
@nntld thank you |
|
Ok? And what expensive operation do you memoize exactly after taking those two out? |
I agree that switching from
It will, however, marginally improve it for free |
|
Taking those values out makes sense, memoizing the assertion afterwards does not. It's either |
Closes #9118
Asserts that all non-read only calls going to the GH API are made with the same token as the currently logged in user.
I chose to do this in the API wrappers where possible, to avoid lots of manual assertions that would be easy to forget for new features.
Tests/screenshots