[Bug]: SilentRenewFailed never gets fired
Version
15.0.2
Please provide the exception or error you saw
The event this.publicEventsService.fireEvent(EventTypes.SilentRenewFailed, error); never gets called, because the unsubscribe from the Observable gets called, before the catchError block is reached.
This error was quite tricky to debug, because of the depth of the different pipes.
In the RefreshSessionRefreshTokenService in the catchError the intervalService gets called, to stop the periodic tokencheck (if an error occurs -> i.e. the accessToken could not be refreshed).
The intervalService then unsubscribes the periodical tokencheck and the catchError block in /periodically-token-check.service.ts never gets called.
A quick fix of the problem would be to move the this.intervalService.stopPeriodicTokenCheck(); to the catchError-block in /periodically-token-check.service.ts to refreshEventWithErrorHandler$. So that the unsubscribe happens there.
Steps to reproduce the behavior
Provoke an error in the silent renew request.
A clear and concise description of what you expected to happen.
EventTypes.SilentRenewFailed to be fired.
Line that unsubscribes: https://github.com/damienbod/angular-auth-oidc-client/blob/ebd035b0bd0537504a2dff4f4a570d0074437ae6/projects/angular-auth-oidc-client/src/lib/callback/refresh-session-refresh-token.service.ts#L29
Block that never gets called because of the unsubscribe: https://github.com/damienbod/angular-auth-oidc-client/blob/6eb8fd18f6df3fbf3122364acf3c7b2c2bfef8bc/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts#L93
@FabianGosebrink Is there any news about this issue? Should I clarify the issue better? I could create a fork. Let me know
Thanks for reaching out. I have to have a look, maybe on the weekend if I find time. If you want to create a fork and a PR, so support this, I'd appreciate it.
https://github.com/damienbod/angular-auth-oidc-client/pull/1655 This could fix the issue
I have encountered similar results, the EventType of 11 is never fired even though the connect/token is failing on a refresh event

export declare enum EventTypes {
/**
* This only works in the AppModule Constructor
*/
ConfigLoaded = 0,
CheckingAuth = 1,
CheckingAuthFinished = 2,
CheckingAuthFinishedWithError = 3,
ConfigLoadingFailed = 4,
CheckSessionReceived = 5,
UserDataChanged = 6,
NewAuthenticationResult = 7,
TokenExpired = 8,
IdTokenExpired = 9,
SilentRenewStarted = 10,
SilentRenewFailed = 11
}
@Tyler-V fancy seeing you here. We're having all the same problems.