@@ -4,7 +4,7 @@ import { getLiveSpecs_detailsForm } from 'api/liveSpecsExt';
4
4
import { GlobalSearchParams } from 'hooks/searchParams/useGlobalSearchParams' ;
5
5
import produce from 'immer' ;
6
6
import { isEmpty } from 'lodash' ;
7
- import { logRocketEvent } from 'services/shared' ;
7
+ import { logRocketConsole , logRocketEvent } from 'services/shared' ;
8
8
import { CustomEvents } from 'services/types' ;
9
9
import { DATA_PLANE_SETTINGS } from 'settings/dataPlanes' ;
10
10
import {
@@ -39,6 +39,9 @@ const getConnectorImage = async (
39
39
connectorId : string ,
40
40
existingImageTag ?: ConnectorVersionEvaluationOptions [ 'existingImageTag' ]
41
41
) : Promise < Details [ 'data' ] [ 'connectorImage' ] | null > => {
42
+ logRocketConsole ( 'DetailsFormHydrator>getConnectorImage' , {
43
+ connectorId,
44
+ } ) ;
42
45
const { data, error } = await getConnectors_detailsForm ( connectorId ) ;
43
46
44
47
if ( ! error && data && data . length > 0 ) {
@@ -190,6 +193,9 @@ export const getInitialState = (
190
193
set (
191
194
produce ( ( state : DetailsFormState ) => {
192
195
if ( connectorImage . id === '' ) {
196
+ logRocketConsole (
197
+ 'DetailsFormHydrator>setDetails_connector>resetting'
198
+ ) ;
193
199
state . details . data . connectorImage =
194
200
getInitialStateData ( ) . details . data . connectorImage ;
195
201
} else {
@@ -293,11 +299,24 @@ export const getInitialState = (
293
299
workflow === 'capture_create' ||
294
300
workflow === 'materialization_create' ;
295
301
302
+ logRocketConsole ( 'DetailsFormHydrator>hydrateState' , {
303
+ connectorId,
304
+ createWorkflow,
305
+ dataPlaneId,
306
+ liveSpecId,
307
+ searchParams : searchParams . toString ( ) ,
308
+ workflow,
309
+ } ) ;
310
+
296
311
if ( connectorId ) {
297
312
let dataPlaneOptions : DataPlaneOption [ ] = [ ] ;
298
313
299
314
const dataPlaneResponse = await getDataPlaneOptions ( ) ;
300
315
316
+ logRocketConsole (
317
+ 'DetailsFormHydrator>hydrateState>getDataPlaneOptions'
318
+ ) ;
319
+
301
320
if (
302
321
! dataPlaneResponse . error &&
303
322
dataPlaneResponse . data &&
@@ -307,6 +326,9 @@ export const getInitialState = (
307
326
generateDataPlaneOption
308
327
) ;
309
328
329
+ logRocketConsole (
330
+ 'DetailsFormHydrator>hydrateState>setDataPlaneOptions'
331
+ ) ;
310
332
get ( ) . setDataPlaneOptions ( dataPlaneOptions ) ;
311
333
} else {
312
334
get ( ) . setHydrationError (
@@ -316,8 +338,25 @@ export const getInitialState = (
316
338
}
317
339
318
340
if ( createWorkflow ) {
341
+ logRocketConsole (
342
+ 'DetailsFormHydrator>hydrateState>createWorkflow'
343
+ ) ;
319
344
const connectorImage = await getConnectorImage ( connectorId ) ;
345
+ logRocketConsole (
346
+ 'DetailsFormHydrator>hydrateState>createWorkflow>getConnectorImage' ,
347
+ {
348
+ connectorId : connectorImage ?. connectorId ,
349
+ connectorImageId : connectorImage ?. id ,
350
+ }
351
+ ) ;
352
+
320
353
const dataPlane = getDataPlane ( dataPlaneOptions , dataPlaneId ) ;
354
+ logRocketConsole (
355
+ 'DetailsFormHydrator>hydrateState>createWorkflow>getDataPlane' ,
356
+ {
357
+ dataPlaneName : dataPlane ?. dataPlaneName ,
358
+ }
359
+ ) ;
321
360
322
361
if ( ! isProduction && connectorImage && dataPlane === null ) {
323
362
get ( ) . setDetails_connector ( connectorImage ) ;
@@ -332,6 +371,10 @@ export const getInitialState = (
332
371
errors,
333
372
} ) ;
334
373
} else if ( connectorImage && dataPlane !== null ) {
374
+ logRocketConsole (
375
+ 'DetailsFormHydrator>hydrateState>createWorkflow>setDetails_connector'
376
+ ) ;
377
+
335
378
get ( ) . setDetails_connector ( connectorImage ) ;
336
379
337
380
const {
@@ -345,6 +388,9 @@ export const getInitialState = (
345
388
errors,
346
389
} ) ;
347
390
} else {
391
+ logRocketConsole (
392
+ 'DetailsFormHydrator>hydrateState>createWorkflow>setHydrationErrorsExist'
393
+ ) ;
348
394
get ( ) . setHydrationErrorsExist ( true ) ;
349
395
}
350
396
} else if ( liveSpecId ) {
@@ -403,6 +449,13 @@ export const getInitialState = (
403
449
} ) ;
404
450
get ( ) . setHydrationErrorsExist ( true ) ;
405
451
}
452
+ } else {
453
+ logRocketEvent ( CustomEvents . CONNECTOR_VERSION_MISSING ) ;
454
+ // TODO (details hydration) should really show an error here
455
+ // get().setHydrationError(
456
+ // 'Unable to locate selected connector. If the issue persists, please contact support.'
457
+ // );
458
+ // get().setHydrationErrorsExist(true);
406
459
}
407
460
} ,
408
461
0 commit comments