Repository navigation
fix(auth): isolate token refresh cancellation between callers - #428
Closed
sylvesterkaczmarek wants to merge 1 commit into
Closed
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Author
|
The regression and related tests pass locally, with the validation details in the PR description. Could a maintainer approve the pending Actions run? |
Contributor
|
Closing along with #427. The reasoning is in #427 (comment). |
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.
Fixes #427.
Return a dependent future to each foreground or joining caller rather than exposing the cache's shared in-flight future. A caller can cancel or complete its own result without cancelling peers, substituting their token, or prematurely launching a chained forced refresh. The provider refresh itself continues and retains ownership of cache publication.
The identity transformation uses Java 8-compatible thenApplyAsync with an explicit common-pool executor, following the repository callback policy without introducing a new executor lifecycle. Provider invocation, refresh thresholds, deduplication and advisory behavior are unchanged. This is independent of #426's refresh-launch exception handling.
Validation
Six deterministic tests cover leader and follower cancellation, later joiners, forced-refresh sequencing, provider failures and retry, caller-local completion, and an advisory control. Five fail on unchanged main and all six pass after the fix. The related auth, credentials and credential-cache suites pass 88 tests.
Kotlin formatting and core-module Kotlin lint passed. Detekt main/test checks passed with their inputs restricted to the two changed Kotlin files, retaining the repository configuration and rules. Full-project Detekt did not complete locally: one attempt exhausted internal temporary space and an external-storage retry hit its JVM memory limit. The successful scoped run used external temporary/cache storage.
Tested on macOS arm64 using JDK 21. Java 8 runtime, full generated API suites and live authentication were not exercised. No public signatures, dependencies, release metadata or workflow changes.