Gutter decoration persists after destroying according marker


I am working a an Atom package code-annotations.
There I create icons in the gutter by basically doing this:

const marker = editor.markBufferRange(range, {invalidate: 'never'})
const gutterIcon = document.createElement('div')
gutter.decorateMarker(marker, {item: gutterIcon})

At some point the icon may be deleted. For this I have

const marker = somehowFindTheWantedMarker()

The Decoration docs say the best way to remove the icon/decoration is to destroy the marker, which I do. But in my case the icon remains. I have verified that the destroyed marker is the one I actually want so I have no idea what I could be doing wrong.

I have even tried destroying the decoration itself by calling .destroy on the decoration returned by gutter.decorateMarker.

Could this be a bug in Atom? Atom issues require to be able to reproduce the bug in Atom’s safe mode. But I can’t do this because I am working a 3rd party package…
I also cannot debug the code since it lives in the Atom core. :confused:

If anyone has a clue I would be really thankful! :slight_smile: