-
Notifications
You must be signed in to change notification settings - Fork 273
AAE-30358 Token is not refreshed in WS connection_init when changing pages #10781
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
base: develop
Are you sure you want to change the base?
AAE-30358 Token is not refreshed in WS connection_init when changing pages #10781
Conversation
@@ -155,10 +160,13 @@ export class WebSocketService { | |||
this.wsLink = new GraphQLWsLink( | |||
createClient({ | |||
url: this.createWsUrl(options.wsUrl) + '/v2/ws/graphql', | |||
connectionParams: { | |||
connectionParams: () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense.
…o use the refreshed token changing the page, turn connectionParams into a function to ensures that the latest token is always used for WebSocket connections
…ql return unauthorized error
18322fd
to
10346db
Compare
|
return false; | ||
} | ||
|
||
const isUnauthorizedError = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can reuse this part to actually catch the error from network when it happens and then try to refresh the token. Same with the retry mechanism instead of having a plain number we can use the retryIf
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
https://hyland.atlassian.net/browse/AAE-30358
What is the new behaviour?
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: