@@ -292,15 +292,19 @@ export class BareReviewsController extends React.Component {
292
292
addSingleComment = async ( commentBody , threadID , replyToID , commentPath , position , callbacks = { } ) => {
293
293
let pendingReviewID = null ;
294
294
try {
295
+ console . log ( `setting state: postingToThreadID=${ threadID } ` ) ;
295
296
this . setState ( { postingToThreadID : threadID } ) ;
296
297
298
+ console . log ( 'calling addReviewMutation' ) ;
297
299
const reviewResult = await addReviewMutation ( this . props . relay . environment , {
298
300
pullRequestID : this . props . pullRequest . id ,
299
301
viewerID : this . props . viewer . id ,
300
302
} ) ;
301
303
const reviewID = reviewResult . addPullRequestReview . reviewEdge . node . id ;
302
304
pendingReviewID = reviewID ;
305
+ console . log ( `addReviewMutation returned: reviewID=${ reviewID } pendingReviewID=${ pendingReviewID } ` ) ;
303
306
307
+ console . log ( 'calling addReviewCommentMutation' ) ;
304
308
const commentPromise = addReviewCommentMutation ( this . props . relay . environment , {
305
309
body : commentBody ,
306
310
inReplyTo : replyToID ,
@@ -310,28 +314,36 @@ export class BareReviewsController extends React.Component {
310
314
path : commentPath ,
311
315
position,
312
316
} ) ;
317
+ console . log ( 'firing didSubmitComment callback' ) ;
313
318
if ( callbacks . didSubmitComment ) {
314
319
callbacks . didSubmitComment ( ) ;
315
320
}
321
+ console . log ( 'awaiting comment promise' ) ;
316
322
await commentPromise ;
323
+ console . log ( 'comment promise resolved successfully' ) ;
317
324
pendingReviewID = null ;
318
325
326
+ console . log ( 'calling submitReviewMutation' ) ;
319
327
await submitReviewMutation ( this . props . relay . environment , {
320
328
event : 'COMMENT' ,
321
329
reviewID,
322
330
} ) ;
331
+ console . log ( 'submitReviewMutation resolved successfully' ) ;
323
332
addEvent ( 'add-single-comment' , { package : 'github' } ) ;
324
333
} catch ( error ) {
334
+ console . log ( `Caught an error: ${ error . stack } ` ) ;
325
335
if ( callbacks . didFailComment ) {
326
336
callbacks . didFailComment ( ) ;
327
337
}
328
338
329
339
if ( pendingReviewID !== null ) {
330
340
try {
341
+ console . log ( 'Calling deleteReviewMutation' ) ;
331
342
await deleteReviewMutation ( this . props . relay . environment , {
332
343
reviewID : pendingReviewID ,
333
344
pullRequestID : this . props . pullRequest . id ,
334
345
} ) ;
346
+ console . log ( 'deleteReviewMutation completed' ) ;
335
347
} catch ( e ) {
336
348
/* istanbul ignore else */
337
349
if ( error . errors && e . errors ) {
0 commit comments