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
#6684 Serialize google login #6781
Conversation
src/background/requests.ts
Outdated
* Get cached auth data for OAuth2, or login if no data found. Memoize so that multiple logins | ||
* are not kicked off at once. | ||
*/ | ||
const getOAuth2AuthData = memoizeUntilSettled( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ NIT: would be good to leave a comment for why its appropriate to wrap here vs. launchOAuth2Flow. I.e., if you wrap launchOAuth2Flow instead you'll get a race condition based on whether or not the auth data has been written by the other call yet
expect( | ||
getOAuth2AuthData(integration, localConfig, sanitizedIntegrationConfig) | ||
).resolves.toEqual(data), | ||
expect( | ||
getOAuth2AuthData(integration, localConfig, sanitizedIntegrationConfig) | ||
).resolves.toEqual(data), | ||
expect( | ||
getOAuth2AuthData(integration, localConfig, sanitizedIntegrationConfig) | ||
).resolves.toEqual(data), | ||
expect( | ||
getOAuth2AuthData(integration, localConfig, sanitizedIntegrationConfig) | ||
).resolves.toEqual(data), | ||
expect( | ||
getOAuth2AuthData(integration, localConfig, sanitizedIntegrationConfig) | ||
).resolves.toEqual(data), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoPilot wanted to be very thorough here, so we're testing 5 asynchronous requests at once... 😆
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6781 +/- ##
=======================================
Coverage 70.09% 70.09%
=======================================
Files 1193 1193
Lines 36910 36916 +6
Branches 6923 6923
=======================================
+ Hits 25871 25878 +7
+ Misses 11039 11038 -1
☔ View full report in Codecov by Sentry. |
What does this PR do?
Checklist
src/tsconfig.strictNullChecks.json
(if possible)