atom / notifications

User notifications
MIT License
74 stars 36 forks source link

Command list generated with commands run after exception is displayed #190

Open rsese opened 6 years ago

rsese commented 6 years ago

Prerequisites

Not run in safe mode so we could use the command added to the init script to generate an error

Description

h/t @Ben3eeE for finding this comment - as mentioned by Lee in https://github.com/atom/atom/issues/11690#issuecomment-217292719:

thank you for pointing out that the command list is generated when the Issue is submitted, not when the dialog is displayed

So when an error notification is displayed, the Commands section generated includes things you do after the dialog is displayed which can be misleading as Lee mentions further in that comment:

That's a bug we should fix ... it could be sending us down some blind alleys πŸ˜€

If you perform enough actions, the actual actions related to generating the error aren't shown since it seems like 16 commands are shown and the rest is truncated?

Steps to Reproduce

Add this to your init.coffee so you can generate an error h/t @lee-dohm:

atom.commands.add 'atom-workspace',
  'custom:throw-error': ->
    throw new Error
  1. Start Atom (not in safe mode so we can use the command above)
  2. From the command palette, run Custom: Throw Error (error notification shows at this point)
  3. Run some other commands e.g. use the command palette to Tree View: Toggle 6 times
  4. Copy the error report to clipboard (click the clipboard icon in the exception dialog)
  5. Paste the error report to examine the Commands section.

Expected behavior: [What you expect to happen]

To see commands up to when the error dialog is displayed.

Actual behavior: [What actually happens]

Commands run after the dialog is displayed are shown in the Commands section:

     -0:06.6.0 tree-view:toggle (input.hidden-input)
     -0:06.0 command-palette:toggle (input.hidden-input)
     -0:05.2.0 core:confirm (input.hidden-input)
     -0:05.2.0 tree-view:toggle (input.hidden-input)
     -0:04.8.0 command-palette:toggle (div.tool-panel.tree-view)
     -0:04.4.0 core:confirm (input.hidden-input)
     -0:04.4.0 tree-view:toggle (div.tool-panel.tree-view)
     -0:04.0 command-palette:toggle (input.hidden-input)
     -0:03.6.0 core:confirm (input.hidden-input)
     -0:03.6.0 tree-view:toggle (input.hidden-input)
     -0:03.0 command-palette:toggle (div.tool-panel.tree-view)
     -0:02.6.0 core:confirm (input.hidden-input)
     -0:02.6.0 tree-view:toggle (div.tool-panel.tree-view)
     -0:02.3.0 command-palette:toggle (input.hidden-input)
     -0:01.9.0 core:confirm (input.hidden-input)
     -0:01.9.0 tree-view:toggle (input.hidden-input)

For comparison, if I copy the error report right after step 2, then the generated Commands section looks like this:

     -0:03.1.0 command-palette:toggle (input.hidden-input)
     -0:01.8.0 core:confirm (input.hidden-input)
     -0:01.8.0 custom:throw-error (input.hidden-input)

Reproduces how often:

100%

Versions

$ atom -v
Atom    : 1.27.0-dev-8ef1a05f2
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0

$ apm -v
apm  1.19.0
npm  3.10.10
node 6.9.5 x64
atom 1.27.0-dev-8ef1a05f2
python 2.7.10

macOS 10.12.6

/cc @Ben3eeE :v: