pulsar
pulsar copied to clipboard
Uncaught Error: Cannot decorate a destroyed marker
Thanks in advance for your bug report!
- [X] Have you reproduced issue in safe mode?
- [X] Have you used the debugging guide to try to resolve the issue?
- [X] Have you checked our FAQs to make sure your question isn't answered there?
- [X] Does your issue already exist?
- [X] Have you checked you are on the latest release of Pulsar?
What happened?
Versions
Atom: 1.63.2022110914 x64 Electron: 12.2.3 OS: linux 6.0.7-arch1-1 Thrown From: Atom Core
Stack Trace
Uncaught Error: Cannot decorate a destroyed marker
At /opt/Pulsar/resources/app.asar/src/decoration-manager.js:220
Error: Cannot decorate a destroyed marker
at DecorationManager.decorateMarker (/app.asar/src/decoration-manager.js:208:21)
at TextEditor.decorateMarker (/app.asar/src/text-editor.js:2797:35)
at GitDiffView.markRange (git-diff-view.js:264:17)
at GitDiffView.updateDiffs (git-diff-view.js:247:25)
Commands
-1:17 tabs:close-all-tabs (div.title.icon.ruby-icon.medium-red)
-1:12.5.0 open-terminal-here:open (div.header.list-item.project-root-header)
Which OS does this happen on?
🐧 Arch based (Manjaro, Garuda, etc.)
OS details
Gnome 43 Wayland
Which CPU architecture are you running this on?
64-bit(x86_64)
What steps are needed to reproduce this?
- Leave open files and a git diff tab
- Close Pulsar
- Open Pulsar and close all tabs when editor has not fully loaded yet
Additional Information:
Issue has been reported in Atom, but was closed due to inactivity atom/atom#19173. This issue is probably triggered by pulsar-edit/github .
seeing a lot of these recently too Fedora
Pulsar : 1.63.2022111017
Electron: 12.2.3
Chrome : 89.0.4389.128
Node : 14.16.0
Have just got this
Versions
** Pulsar**: 1.101.0-beta x64 Electron: 12.2.3 OS: macOS 13.1 Thrown From: Atom Core
Stack Trace
Uncaught Error: Cannot decorate a destroyed marker
At /Applications/Pulsar.app/Contents/Resources/app.asar/src/decoration-manager.js:220
Error: Cannot decorate a destroyed marker
at DecorationManager.decorateMarker (/app.asar/src/decoration-manager.js:208:21)
at TextEditor.decorateMarker (/app.asar/src/text-editor.js:2797:35)
at GitDiffView.markRange (git-diff-view.js:264:17)
at GitDiffView.updateDiffs (git-diff-view.js:247:25)
Commands
-4:27 core:backspace (input.hidden-input)
-4:26.7.0 core:move-right (input.hidden-input)
-4:26.1.0 core:save (input.hidden-input)
5x -3:48.5.0 core:move-left (input.hidden-input)
-3:46.8.0 core:delete (input.hidden-input)
-3:46 github:commit (input.hidden-input)
Non-Core Packages
auto-dark-mode 0.6.0
auto-indent 0.5.0
language-nagios 0.2.0
language-nginx 0.8.0
project-manager 3.3.8
Any update here?
able to reproduce (yay?) using Apple Silicon Pulsar from CI on the macos code signing PR and macOS Ventura 13.2 (public beta), and also in safe mode.
Uncaught Error: Cannot decorate a destroyed marker
At /Applications/Pulsar.app/Contents/Resources/app.asar/src/decoration-manager.js:220
Error: Cannot decorate a destroyed marker
at DecorationManager.decorateMarker (/app.asar/src/decoration-manager.js:208:21)
at TextEditor.decorateMarker (/app.asar/src/text-editor.js:2797:35)
at GitDiffView.markRange (git-diff-view.js:264:17)
at GitDiffView.updateDiffs (git-diff-view.js:247:25)
Commands
5x -0:22.2.0 core:close (atom-pane.pane.active)
-0:08.6.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
No non-core packages
My educated guess (maybe its obvious) is that the git diff view was closed before it was fully initialised, so the code to initialise is still in the process of running, but the instance was destroyed. So, a race condition of sorts. Here the error is thrown while its still initialising: https://github.com/pulsar-edit/pulsar/blob/1da0dab087d99d62051ded5b53ad9d90e3b62398/packages/git-diff/lib/git-diff-view.js#L247
actually nuh i didn't follow the stacktrace up. Here is where the error is constructed and thrown:
https://github.com/pulsar-edit/pulsar/blob/8d52f907c4fa8fadf1961412c223fcc0f681abd3/src/decoration-manager.js#L207-L221
I think this would be an edge case. maybe its best to just log an error but silently ignore it?
Might be a good way. I only see this error for git-diff-view anyways (since a long time in Atom and Pulsar :smile: ). Just log it into the devtools and not show the error box. Of course fixing the source would be better but since everything works fine after closing the error message it could be a simple log
(Without researching into why this happens with github
) Since it sounds like this only happens when the package's pane is closed before it's done writing updates to it, we could modify any long running tasks to double check that their marker is still available before trying to write to it? So that way if it's not then the task will just stop so the error is never triggered?
actually that's exactly what the throwing code is doing! (checking if the marker is destroyed already) :p
actually that's exactly what the throwing code is doing! (checking if the marker is destroyed already) :p
Oh wow, then ignore my previous comment. Yeah then I'm not to sure if this has to be a big error. Unless this exists as an error to protect some other state we aren't thinking of? Since if the only time this would really happen is when the user closes the tab then we shouldn't care about it being gone
Throwing the error does stop the operation, but I think it would achieve the same effect if you just console.error
and return
early? plus it doesn't give you red in your face error
@Meadowsys did you have time to look at this one?
Still getting this error.
/Applications/Pulsar.app/Contents/Resources/app.asar/src/decoration-manager.js:220 Hide Stack Trace Error: Cannot decorate a destroyed marker at DecorationManager.decorateMarker (/Applications/Pulsar.app/Contents/Resources/app.asar/src/decoration-manager.js:208:21) at TextEditor.decorateMarker (/Applications/Pulsar.app/Contents/Resources/app.asar/src/text-editor.js:2797:35) at GitDiffView.markRange (git-diff-view.js:264:17) at GitDiffView.updateDiffs (git-diff-view.js:247:25)
What's weird about this is that it implies the marker is destroyed already when it's returned from markBufferRange
, since there's nothing async between line 264 and the exception being thrown:
https://github.com/pulsar-edit/pulsar/blob/1da0dab087d99d62051ded5b53ad9d90e3b62398/packages/git-diff/lib/git-diff-view.js#L261-L265
No idea why, but it does make a band-aid fix possible for this specific issue without requiring that we suppress all exceptions whenever someone tries to decorate a destroyed marker.
Thanks @savetheclocktower !! Looking very good so far.