Electron snap killed when using app.makeSingleInstance API

Some further testing. Uninstalling the snap and reinstalling it with --devmode resolves the issue, so it definitely seems to be a sandbox problem. When run in devmode, the syslog output looks like this, and the newly launched mailspring instance exits correctly and passes it’s launch params to the other running instance.

Oct 31 23:49:55 bengotow-virtual-machine kernel: [14736.808454] audit: type=1400 audit(1509518995.391:173): apparmor="ALLOWED" operation="open" profile="snap.mailspring.mailspring" name="/etc/xdg/user-dirs.conf" pid=41639 comm="xdg-user-dirs-u" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Oct 31 23:49:55 bengotow-virtual-machine kernel: [14736.858866] audit: type=1400 audit(1509518995.443:174): apparmor="ALLOWED" operation="file_mmap" profile="snap.mailspring.mailspring" name="/home/bengotow/.config/dconf/user" pid=41622 comm="mailspring" requested_mask="m" denied_mask="m" fsuid=1000 ouid=1000
Oct 31 23:49:55 bengotow-virtual-machine kernel: [14737.060676] audit: type=1400 audit(1509518995.643:175): apparmor="ALLOWED" operation="file_perm" profile="snap.mailspring.mailspring" name="/run/user/1000/snap.mailspring/.org.chromium.Chromium.Dytsxb/SS" pid=41622 comm="mailspring" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Oct 31 23:49:55 bengotow-virtual-machine kernel: [14737.060678] audit: type=1400 audit(1509518995.643:176): apparmor="ALLOWED" operation="file_perm" profile="snap.mailspring.mailspring" name="/run/user/1000/snap.mailspring/.org.chromium.Chromium.Dytsxb/SS" pid=41622 comm="mailspring" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

This seems like it might be similar to Would someone create an electron snap for this forum?.

EDIT: I also tried updating core to the very latest version (2.29+git446.aaee286) in case this might be fixed by this recent commit: https://github.com/snapcore/snapd/pull/4097/files/. No luck though.

I’m not sure where to look next @kyrofa —it seems like denying access to /home/bengotow/.config/dconf/user might be important, but I don’t know enough about dconf to know. (I’m a long time Mac + iOS developer but fairly noob linux user.) Mailspring is a fairly standard Electron application, so any changes required for this would likely also be relevant for other Electron apps.