Conversation
Fires when a transparent refresh itself throws (refresh token revoked, expired, or rescoped) - character is unchanged, the triggering call still fails, but a registered sink now gets a chance to react (e.g. flag the character so other jobs stop querying it) before that exception propagates. Fixes the test build: FakeSink predated this interface member and didn't implement it. Adds a dedicated failure-path test and documents the hook in the README's DbTokenSink example and the CHANGELOG. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
❌ The last analysis has failed. |
Owner
Author
|
Superseded — cherry-picked this commit (a356771) directly onto (For the record: the SonarCloud check failure here was the scan itself erroring out — "the last analysis has failed" — not a reported code-quality issue. |
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.
What
Adds a failure hook to
IEsiTokenRefreshSink:OnRefreshFailedAsync(character, exception), called when a transparent access-token refresh itself throws (refresh token revoked, expired, or the app's scopes changed).characteris unchanged from before the attempt, and the triggering call still throws either way - this just gives a registered sink a chance to react (e.g. flag the character in your own store so other jobs stop querying it) before that exception propagates.Why
Real-world need: a consumer's background jobs query many characters' data on a schedule and need to skip characters whose credentials have gone bad, rather than repeatedly failing against them. Until now there was no signal that a refresh failed at all - only the exception from whichever call happened to trigger it.
Verified
SsoLogic.RefreshAccessTokenAsync- the token exchange throws before mutatingcharacter, so "character is unchanged" in the XML doc is accurate, not aspirational.TokenRefreshTests.FakeSinkpredated this interface member and didn't implement it - broke the test build (CS0535). Fixed, and addedFailed_refresh_notifies_the_sink_and_still_throws, asserting: the sink's failure hook fires with the right character/exception,OnRefreshedAsyncdoes not also fire, the exception still propagates, and the character's token/refresh-token are untouched.DbTokenSinkexample (using the realCanQueryEsi-style pattern that motivated this) and in the CHANGELOG.Notes
EsiCallOptions) equivalent added deliberately - a one-off caller already gets the exception directly from the failed call, so a duplicate callback would be redundant. The sink is for the DI/background-job case where nothing is already watching that call.🤖 Generated with Claude Code