[P1] Reduce Apple login provider round trips#327
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #323 by removing repeated Apple provider round trips from the returning Apple User login path and recording before/after benchmark evidence.
Root cause
Returning Apple Users still paid for two blocking Apple provider calls on every login request:
auth/tokenexchange before the backend checked whether the Apple User already existed locallyThat made the returning-user path depend on provider latency even when the local identity and existing User were enough to issue OnTime login tokens.
Changes
kid.auth/tokenexchange for returning Apple Users.docs/performance/apple-login-323.mdwith quick and bounded full before/after results.Performance evidence
Full bounded run (
RUNS=3 WARMUP_DURATION=30s MEASUREMENT_DURATION=60s):Quick and full summary CSVs are included under
scripts/benchmarks/apple-login/results/*/summary.csv.Validation
./gradlew test --tests devkor.ontime_back.global.oauth.apple.AppleLoginServiceTest --tests devkor.ontime_back.global.oauth.OAuthLoginFilterValidationTest./gradlew checkgit diff --checkgit diff --cached --checkscripts/benchmarks/apple-login/run.sh before quickscripts/benchmarks/apple-login/run.sh after quickRUNS=3 WARMUP_DURATION=30s MEASUREMENT_DURATION=60s scripts/benchmarks/apple-login/run.sh before fullRUNS=3 WARMUP_DURATION=30s MEASUREMENT_DURATION=60s scripts/benchmarks/apple-login/run.sh after full