Skip to content

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

alep85
Copy link
Contributor

@alep85 alep85 commented Apr 10, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

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")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@@ -155,10 +160,13 @@ export class WebSocketService {
this.wsLink = new GraphQLWsLink(
createClient({
url: this.createWsUrl(options.wsUrl) + '/v2/ws/graphql',
connectionParams: {
connectionParams: () => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense.

alep85 added 2 commits April 14, 2025 14:56
…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
@alep85 alep85 force-pushed the fix/AAE-30358-ws-token-is-not-refreshed-in-ws-connection-init-when-changing-pages branch from 18322fd to 10346db Compare April 14, 2025 12:57
return false;
}

const isUnauthorizedError =
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

3 participants