Github: Unable to view reviews on PR

Created on 9 Oct 2019  Â·  8Comments  Â·  Source: atom/github

Prerequisites

Description


Unable to view reviews on PR.

Steps to Reproduce

Edit: This are woefully incorrect

  1. fork a repo
  2. make a change and open pr on original repo not fork
  3. have someone review this pr with a comment in the code
  4. make a change which outdates the comment
  5. try to open PR reviews from that PR.

Expected behavior:


See reviews

Actual behavior:

Uncaught (in promise) TypeError: Cannot read property 'diffToFilePosition' of undefined
    at ReviewsView.getTranslatedPosition (C:\Users\Wade\Documents\GitHub\github/reviews-view.js:631:40)
    at ReviewsView.commentThread (C:\Users\Wade\Documents\GitHub\github/reviews-view.js:389:45)
    at Array.map (<anonymous>)
    at ReviewsView.renderReviewCommentThreads (C:\Users\Wade\Documents\GitHub\github/reviews-view.js:359:30)
    at ReviewsView.render (C:\Users\Wade\Documents\GitHub\github/reviews-view.js:143:17)
    at Mh (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:173:192)
    at Lh (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:172:282)
    at mj (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:247:361)
    at jj (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:216:164)
    at Z (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:210:471)
    at $i (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:206:372)
    at C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:114:115
    at exports.unstable_runWithPriority (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\node_modules\scheduler\cjs\scheduler.production.min.js:20:134)
    at vf (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:113:325)
    at yf (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:114:61)
    at O (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:113:476)
    at eg (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:204:235)
    at Object.enqueueSetState (C:\Users\Wade\Documents\GitHub\github\node_modules\react-dom\cjs\react-dom.production.min.js:127:237)
    at ObserveModel.D.setState (C:\Users\Wade\Documents\GitHub\github\node_modules\react\cjs\react.production.min.js:13:231)
    at ModelObserver.ObserveModel._defineProperty [as didUpdate] (C:\Users\Wade\Documents\GitHub\github/observe-model.js:49:12)
    at ModelObserver._refreshModelData (C:\Users\Wade\Documents\GitHub\github/model-observer.js:52:14)

Reproduces how often:


100% with this setup.

Versions


Atom : 1.42.0-nightly8
Electron: 4.2.7
Chrome : 69.0.3497.128
Node : 10.11.0

OS: Windows 10

Additional Information

bug

All 8 comments

Thanks for reporting - I was unable to reproduce on Windows 10 with 1.42.0-nightly8 but I tested with a toy repository. Were you able to reproduce with multiple repositories/pull requests? Is there a public repository + pull request that causes the error that we can test with?

Repository I was using is nteract/hydrogen and the PR that seems to cause this is nteract/hydrogen#1715. It may also be worth noting that is the branch I have checked out too.

Maybe I am assuming the steps incorrectly.

Also you may need to note I am using the master branch of atom/github. The error also only kicks in when I click "see reviews" the rendered page works just fine.

here is the line its breaking on. This reason is because rootComment.path is lib\config.js, but in translations the key is lib/config.js this causes the function unable to find my translations.

A quick solution to my problems is to change line 630 to const translationsForFile = translations.get(path.normalize(rootComment.path));

@wadethestealth Good sleuthing. Want to add a test case and make a PR?

@smashwilson I was already on it 🤣

Haha excellent

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ben3eeE picture Ben3eeE  Â·  4Comments

move[bot] picture move[bot]  Â·  3Comments

smashwilson picture smashwilson  Â·  4Comments

JamesChevalier picture JamesChevalier  Â·  4Comments

simurai picture simurai  Â·  3Comments