Skip to content

Commit

Permalink
fix(xo-web): don't sign out on connection error (#7103)
Browse files Browse the repository at this point in the history
May fix zammad#17717

Introduced by 005ab47
  • Loading branch information
julien-f committed Oct 18, 2023
1 parent 9b236a6 commit 2924f82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [Usage report] Fix "Converting circular structure to JSON" error
- [Home] Fix OS icons alignment (PR [#7090](https://github.com/vatesfr/xen-orchestra/pull/7090))
- [SR/Advanced] Fix the total number of VDIs to coalesce by taking into account common chains [#7016](https://github.com/vatesfr/xen-orchestra/issues/7016) (PR [#7098](https://github.com/vatesfr/xen-orchestra/pull/7098))
- Don't require to sign in again in XO after losing connection to XO Server (e.g. when restarting or upgrading XO) (PR [#7103](https://github.com/vatesfr/xen-orchestra/pull/7103))

### Packages to release

Expand Down
8 changes: 7 additions & 1 deletion packages/xo-web/src/common/xo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ const xo = invoke(() => {
credentials: { token },
})

xo.on('authenticationFailure', signOut)
xo.on('authenticationFailure', error => {
console.warn('authenticationFailure', error)

if (error.name !== 'ConnectionError') {
signOut(error)
}
})
xo.on('scheduledAttempt', ({ delay }) => {
console.warn('next attempt in %s ms', delay)
})
Expand Down

0 comments on commit 2924f82

Please sign in to comment.