fix!: return Observable from logoffLocal and logoffLocalMultiple#2212
Open
FabianGosebrink wants to merge 4 commits into
Open
fix!: return Observable from logoffLocal and logoffLocalMultiple#2212FabianGosebrink wants to merge 4 commits into
FabianGosebrink wants to merge 4 commits into
Conversation
Both methods were returning void while subscribing internally to ConfigurationService.getOpenIDConfigurations(). The internal subscribe had no error handler and gave callers no way to know when the logoff finished, await it, or chain follow-up work — out of line with the sibling methods (logoff, logoffAndRevokeTokens, revokeAccessToken, revokeRefreshToken) which all return Observable. Return Observable<unknown> from both methods. Use pipe(map(...)) so the logoff side-effect runs once per subscriber, matching idiomatic RxJS lazy semantics. BREAKING CHANGE: callers of logoffLocal() / logoffLocalMultiple() must now subscribe (or otherwise consume the observable) for the logoff to fire. Existing code that called these and ignored the void return now needs `.subscribe()` appended. JSDoc updated to call this out. Updates the one in-repo consumer (sample-code-flow-http-config home component) to follow the new pattern. Fixes #2066
Add an Unreleased entry to CHANGELOG.md flagging the BREAKING shift from void to Observable for logoffLocal() / logoffLocalMultiple(). Update docs/site login-logout.md so the code samples show the new .subscribe() pattern, add a callout under both methods explaining the change, and add the previously-undocumented logoffLocalMultiple() section.
3 tasks
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.
Callers of
OidcSecurityService.logoffLocal()andlogoffLocalMultiple()must now.subscribe()(or pipe into something that gets subscribed) for the logoff to actually fire.Summary
void→Observable<unknown>for bothlogoffLocal()andlogoffLocalMultiple()..subscribe()replaced withpipe(map(...))— idiomatic lazy RxJS.sample-code-flow-http-config/home.component.ts) updated to follow the new pattern.Fixes #2066
Why
Previously these two methods:
voidwhile subscribing internally toConfigurationService.getOpenIDConfigurations().logoff*/revoke*methods on the service that returnedvoid— all siblings already returnObservable.Issue #2066 explicitly asks for Promise/Observable return. This brings the two outliers in line with the rest of the public surface.
Migration
Anywhere you call these methods today, append
.subscribe():Now you can also do things you couldn't before:
Test plan
npm run lint-libcleanOut of scope (intentionally)
periodically-token-check.service.ts:83-96was also flagged in the original analysis as "subscription leak." It actually subscribes to an auto-completingof()-based observable, so there's no real memory leak — but the pattern is still ugly. Better handled in its own focused PR that refactors the periodic-check pipeline.logoffLocal$etc.) added — the existing names are now Observable, matching the sibling methods.🤖 Generated with Claude Code