Issue 1784: Keyboard shortcut "r" (Review and publish comments) broken as
Status:  Submitted
Owner: ----
Closed:  May 2013
Reported by krinklemail@gmail.com, Feb 12, 2013
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version: 2.5.2-1277-gca0bdda

What steps will reproduce the problem?
1. View diff of a change (Side-by-Side or Unified).
2. Create an inline comment and save the draft.
3. Press keyboard shortcut "r"

What is the expected output?
Viewport navigates from diff to #,publish

What do you see instead?
Viewport remains unchanged, the following exceptions is consistently thrown regardless of the change, comment or diff mode:


Uncaught TypeError: Cannot read property 'canEditTopicName_0' of null
> $topic
> $display_22
> $display_21
> $display_31
> preDisplay_14
> onSuccess_12 (program):3937
> $onSuccess_45
> onSuccess_95
> invoke
> onResponseReceived_1
> $fireOnResponseReceived
> onReadyStateChange_0
> (anonymous function)
> apply_3
> entry0
> (anonymous function)


Note that the user is not anywhere near the topic or commit message editor. From a never before seen change, straight to the diff, saving an inline comment draft and pressing "r".

Apr 22, 2013
#1 krinklemail@gmail.com
*bump*

On Gerrit 2.6-rc0-328-g72b7141 I still routinely get uncaught exceptions and a hanging "Working..." message when pressing "r" from the diff view.

Uncaught TypeError: Cannot read property 'j' of null
> $M
> YM
> sM
> BU
> eV
> E5
> G5
> JU
> aV
> ko
> j7
> o7
> T8
> nXb
> NXb
> (anonymous function)
> AMb
> DMb
> (anonymous function)

* Go to a change
* View side-by-side diff of a file
* Create an inline comment and save the draft
* Press "r" on keyboard

The yellow "Working..." notice stays visible indefinitely (even when navigating to another page) and the console shows the above uncaught exception.
May 14, 2013
#2 krinklemail@gmail.com
*bump*

Do you use your own software? I can't imagine not experiencing significant slowdown in workflow. Whenever I leave an inline comment I used to be able to press "r" to go to the submission form of that patch set. Now I need to scroll to "Up to change", then I need to remember in which patch set I created the drafts, expand that section, click "Review" and publish comments. That's a lot of steps for a simple comment.

I'd think an uncaught exceptions at run-time is a serious regression. 
May 14, 2013
#3 sop@google.com
I use 'r' all of the time. I am fairly certain we fixed this somewhere between ca0bdda and current master.

Unfortunately the stack trace you captured in comment #2 is useless because it comes from the obfuscated and compressed JS output by the GWT compiler. You should be able to reload the debug JS with ?dbg=1 in the URL to get a nicer looking stack trace.
Status: Submitted
May 14, 2013
#4 krinklemail@gmail.com
I encountered it again just now on gerrit.wikimedia.org (running 2.6-rc0-328-g72b7141[1][2]).

I couldn't reproduce it again however (neither with dbg=1). It appears to hard to reproduce.

[1] https://gerrit.googlesource.com/gerrit/+/72b7141
[2] https://github.com/wikimedia/gerrit/commit/72b7141
May 14, 2013
#5 krinklemail@gmail.com
I caught it, this time with ?dbg=1

Steps to reproduce (likely contains more details than required to reproduce it, haven't narrowed it down yet)

* A change in a repo where I have merge access. The change has multiple patch sets.
* A draft has been saved in a patch set that isn't the oldest.
* View the draft in diff mode (in my case the third comment on https://gerrit.wikimedia.org/r/?dbg=1#/c/61057/6/includes/OutputPage.php from 5 minutes ago)
* Edit the draft and save it again
* Press 'r' while scrolled down a bit

Version: 2.6-rc0-328-g72b7141

Stack (appears unchanged since 2.5.x): 

Uncaught TypeError: Cannot read property 'canEditTopicName_0' of null 32B80AB904B23D1A9625AEEC699C7344.cache.html:41082
$canEditTopicName 32B80AB904B23D1A9625AEEC699C7344.cache.html:41082
$topic_1 32B80AB904B23D1A9625AEEC699C7344.cache.html:23505
$display_22 32B80AB904B23D1A9625AEEC699C7344.cache.html:23466
$display_21 32B80AB904B23D1A9625AEEC699C7344.cache.html:23137
$display_31 32B80AB904B23D1A9625AEEC699C7344.cache.html:27774
$onSuccess_65 32B80AB904B23D1A9625AEEC699C7344.cache.html:28102
onSuccess_74 32B80AB904B23D1A9625AEEC699C7344.cache.html:28119
$getImpl_0 32B80AB904B23D1A9625AEEC699C7344.cache.html:35647
get_29 32B80AB904B23D1A9625AEEC699C7344.cache.html:35661
$preDisplay_14 32B80AB904B23D1A9625AEEC699C7344.cache.html:27926
$preDisplay_15 32B80AB904B23D1A9625AEEC699C7344.cache.html:28077
preDisplay_14 32B80AB904B23D1A9625AEEC699C7344.cache.html:28092
onSuccess_13 32B80AB904B23D1A9625AEEC699C7344.cache.html:8506
$onSuccess_85 32B80AB904B23D1A9625AEEC699C7344.cache.html:36408
onSuccess_95 32B80AB904B23D1A9625AEEC699C7344.cache.html:36467
invoke 32B80AB904B23D1A9625AEEC699C7344.cache.html:76574
onResponseReceived_1 32B80AB904B23D1A9625AEEC699C7344.cache.html:77398
$fireOnResponseReceived 32B80AB904B23D1A9625AEEC699C7344.cache.html:60693
onReadyStateChange 32B80AB904B23D1A9625AEEC699C7344.cache.html:60941
(anonymous function) 32B80AB904B23D1A9625AEEC699C7344.cache.html:74236
apply_2 32B80AB904B23D1A9625AEEC699C7344.cache.html:55715
entry0 32B80AB904B23D1A9625AEEC699C7344.cache.html:55774
(anonymous function) 32B80AB904B23D1A9625AEEC699C7344.cache.html:55745

Oct 7, 2013
#6 krinklemail@gmail.com
Still happening as of v2.7-rc2-505-g7502a46. Almost every other review when I add an inline comment and press "r", I get this exception (and an ever lasting "Working..." message on top).
Oct 7, 2013
#7 krinklemail@gmail.com
Mon Oct 07 22:05:47 GMT+200 2013 Class$3
SEVERE: (TypeError)
 stack: TypeError: Cannot read property 'canEditTopicName_0' of null
    at $topic (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:5836:19)
    at $display_21 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:5797:41)
    at $display_20 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:5647:3)
    at $display_30 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9012:3)
    at Object.onSuccess_80 [as onSuccess] (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9328:3)
    at $getImpl (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:10737:8)
    at get_1 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:10749:3)
    at $preDisplay_0 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9195:3)
    at Object.preDisplay_12 [as preDisplay] (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9308:3)
    at $onSuccess_7 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:4028:17): Cannot read property 'canEditTopicName_0' of null
Class$S1189: (TypeError)
 stack: TypeError: Cannot read property 'canEditTopicName_0' of null
    at $topic (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:5836:19)
    at $display_21 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:5797:41)
    at $display_20 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:5647:3)
    at $display_30 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9012:3)
    at Object.onSuccess_80 [as onSuccess] (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9328:3)
    at $getImpl (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:10737:8)
    at get_1 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:10749:3)
    at $preDisplay_0 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9195:3)
    at Object.preDisplay_12 [as preDisplay] (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:9308:3)
    at $onSuccess_7 (gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html:4028:17): Cannot read property 'canEditTopicName_0' of null
	at Unknown.$topic(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@19)
	at Unknown.$display_21(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@41)
	at Unknown.$display_20(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@3)
	at Unknown.$display_30(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@3)
	at Unknown.onSuccess_80(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@3)
	at Unknown.$getImpl(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@8)
	at Unknown.get_1(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@3)
	at Unknown.$preDisplay_0(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@3)
	at Unknown.preDisplay_12(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@3)
	at Unknown.$onSuccess_7(gerrit_ui/BDC60E0CF3F24FEA7E8212E67BEF50E1.cache.html@17)