Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: SilentRenewFailed never gets fired #1649

Open
benthieu opened this issue Jan 9, 2023 · 6 comments
Open

[Bug]: SilentRenewFailed never gets fired #1649

benthieu opened this issue Jan 9, 2023 · 6 comments
Assignees

Comments

@benthieu
Copy link
Contributor

benthieu commented Jan 9, 2023

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.

@benthieu
Copy link
Contributor Author

benthieu commented Jan 9, 2023

Line that unsubscribes:

Block that never gets called because of the unsubscribe:

@FabianGosebrink FabianGosebrink self-assigned this Jan 10, 2023
@benthieu
Copy link
Contributor Author

benthieu commented Jan 17, 2023

@FabianGosebrink Is there any news about this issue? Should I clarify the issue better? I could create a fork. Let me know

@FabianGosebrink
Copy link
Collaborator

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.

@benthieu
Copy link
Contributor Author

#1655
This could fix the issue

@Tyler-V
Copy link

Tyler-V commented Feb 14, 2023

I have encountered similar results, the EventType of 11 is never fired even though the connect/token is failing on a refresh event

image

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
}

@bluebaroncanada
Copy link

@Tyler-V fancy seeing you here. We're having all the same problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants