fix(xo-server-transport-xmpp): fix loading (#7082)

Fixes https://xcp-ng.org/forum/post/66402

Introduced by d6fc86b6b
This commit is contained in:
Julien Fontanet 2023-10-25 14:36:40 +02:00 committed by GitHub
parent df91772f5c
commit 62208e7847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View File

@ -28,6 +28,7 @@
- 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)) - 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))
- [Usage report] Fix "Converting circular structure to JSON" error (PR [#7096](https://github.com/vatesfr/xen-orchestra/pull/7096)) - [Usage report] Fix "Converting circular structure to JSON" error (PR [#7096](https://github.com/vatesfr/xen-orchestra/pull/7096))
- [Usage report] Fix "Cannot convert undefined or null to object" error (PR [#7092](https://github.com/vatesfr/xen-orchestra/pull/7092)) - [Usage report] Fix "Cannot convert undefined or null to object" error (PR [#7092](https://github.com/vatesfr/xen-orchestra/pull/7092))
- [Plugin/transport-xmpp] Fix plugin load
### Packages to release ### Packages to release
@ -52,6 +53,7 @@
- xo-server minor - xo-server minor
- xo-server-backup-reports minor - xo-server-backup-reports minor
- xo-server-netbox patch - xo-server-netbox patch
- xo-server-transport-xmpp patch
- xo-server-usage-report patch - xo-server-usage-report patch
- xo-web minor - xo-web minor

View File

@ -29,8 +29,7 @@
"node": ">=10" "node": ">=10"
}, },
"dependencies": { "dependencies": {
"@xmpp/client": "^0.13.1", "@xmpp/client": "^0.13.1"
"promise-toolbox": "^0.21.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.0.0", "@babel/cli": "^7.0.0",

View File

@ -1,4 +1,3 @@
import fromEvent from 'promise-toolbox/fromEvent'
import { client, xml } from '@xmpp/client' import { client, xml } from '@xmpp/client'
// =================================================================== // ===================================================================
@ -56,10 +55,7 @@ class TransportXmppPlugin {
async load() { async load() {
this._client = client(this._conf) this._client = client(this._conf)
this._client.on('error', () => {}) await this._client.start()
await fromEvent(this._client.connection.socket, 'data')
await fromEvent(this._client, 'online')
this._unset = this._set('sendToXmppClient', this._sendToXmppClient) this._unset = this._set('sendToXmppClient', this._sendToXmppClient)
} }