Skip to content

Commit 9bea259

Browse files
doublefacedoubleface
doubleface
authored andcommittedNov 22, 2021
fix: Handle undefined this.konnector for OAuth connectors
In ConnectionFlow, this.konnector is undefined. I don't see any justification for that but it won't have any other nagative effect on the connector exection. This causes a fatal error on all applications using harvest and trying to configure an OAuth connector This is a hotfix. We will check why this variable is undefined in later investigation

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎packages/cozy-harvest-lib/src/models/ConnectionFlow.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import MicroEE from 'microee'
2+
import get from 'lodash/get'
23

34
import Realtime from 'cozy-realtime'
45
import flag from 'cozy-flags'
@@ -483,7 +484,7 @@ export class ConnectionFlow {
483484
*/
484485
async launch({ autoSuccessTimer = true } = {}) {
485486
const computedAutoSuccessTimer =
486-
autoSuccessTimer && !this.konnector.clientSide
487+
autoSuccessTimer && !get(this, 'konnector.clientSide')
487488

488489
logger.info('ConnectionFlow: Launching job...')
489490
this.setState({ status: PENDING })
@@ -501,7 +502,7 @@ export class ConnectionFlow {
501502

502503
this.job = await launchTrigger(this.client, this.trigger)
503504

504-
if (this.konnector.clientSide) {
505+
if (get(this, 'konnector.clientSide')) {
505506
logger.info(
506507
'This connector can be run by the launcher',
507508
this.konnector.slug

0 commit comments

Comments
 (0)
Please sign in to comment.