Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification close() causes app crash at exit #18701

Closed
johaven opened this issue Jun 9, 2019 · 6 comments · Fixed by #21709
Closed

Notification close() causes app crash at exit #18701

johaven opened this issue Jun 9, 2019 · 6 comments · Fixed by #21709
Assignees
Labels

Comments

@johaven
Copy link

johaven commented Jun 9, 2019

  • Electron Version:
    • 5.0.x
  • Operating System:
    • macOS 10.14.5

Expected Behavior

Electron does not crash at exit.

Actual Behavior

The notifications are sent well, i use the close() function to avoid persistence in Notification Center.

By doing this every time I quit the application I have a message that warns me that the application did not stop properly.

To Reproduce

const notif = new Notification({title: title, body: body, silent: true})
notif.on('click', () => appEvent.emit('show-window'))
notif.show()
setTimeout(() => notif.close(), 10000)

After sending notification(s), close application (app.quit()) and the error will appear.

To no longer have the error after quitting app, i do not use the function close () but my application generates a lot of notifications and I would have preferred to handle that.

@codebytere
Copy link
Member

This is not in itself a reproducible piece of code, as it doesn't give me enough context about how you're using it. Please attach a more complete piece of error-inducing code for the maintainers to triage this issue. I put:

  const notif = new Notification({title: 'title', body: 'body', silent: true})
  notif.on('click', () => console.log('hi'))
  notif.show()
  setTimeout(() => notif.close(), 10000)

in a quick-start main process and could not reproduce this.

@johaven
Copy link
Author

johaven commented Jun 10, 2019

@codebytere could you try this:

let count = 0

send(title, body) {
        const notif = new Notification({title: title, body: body, silent: true})
        notif.once('click', () => console.log('tick'))
        notif.show()
        setTimeout(() => {notif.close(); if (count === 5){app.quit()}}, 10000)
}

setInterval(() => {this.send('test', 'test'); count += 1},15000)

@MarshallOfSound
Copy link
Member

Fwiw I think I reproed this (either that or I found a different notification crash). I think it might be related to my recent notification reset fix

@codebytere
Copy link
Member

Repro'd successfully @johaven, thanks!

Crash report:

Received signal 10 BUS_ADRERR 7fff92d041d8

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   ???                           	0x00007fff92d041d8 __CFConstantStringClassReference + 0
1   com.github.Electron.framework 	0x000000010af898de 0x108d6a000 + 35780830
2   com.github.Electron.framework 	0x000000010af8b46f 0x108d6a000 + 35787887
3   com.github.Electron.framework 	0x000000010af8adb0 0x108d6a000 + 35786160
4   com.github.Electron.framework 	0x000000010af4da97 0x108d6a000 + 35535511
5   com.github.Electron.framework 	0x000000010af4db2e 0x108d6a000 + 35535662
6   com.github.Electron.framework 	0x0000000108d6c45f AtomMain + 95
7   com.github.Electron           	0x0000000108d3b9b0 0x108d3a000 + 6576
8   libdyld.dylib                 	0x00007fff6389a3d5 start + 1

@codebytere codebytere self-assigned this Jun 10, 2019
@abettadapur
Copy link

We are seeing something similar. We symbolicated the trace and got the following:

atom::Notification::~Notification() (in Electron Framework) (notification.cc:21)
atom::CocoaNotification::~CocoaNotification() (in Electron Framework) (cocoa_notification.mm:20)
atom::NotificationPresenter::~NotificationPresenter() (in Electron Framework) (notification_presenter.cc:16)
atom::NotificationPresenterMac::~NotificationPresenterMac() (in Electron Framework) (notification_presenter_mac.mm:41)
atom::AtomBrowserClient::~AtomBrowserClient() (in Electron Framework) (atom_browser_client.cc:175)
atom::AtomBrowserClient::~AtomBrowserClient() (in Electron Framework) (atom_browser_client.cc:172)
AtomMain (in Electron Framework) (atom_library_main.mm:24)

@bkakadiya42
Copy link

bkakadiya42 commented Jan 8, 2020

@abettadapur based on your crash log, i think you might be experiencing this extremely similar (and possibly duplicate) issue: #19842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants