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

default timeout not passed onto terminal-notifier #218

Closed
clawconduce opened this issue Jan 25, 2018 · 11 comments
Closed

default timeout not passed onto terminal-notifier #218

clawconduce opened this issue Jan 25, 2018 · 11 comments

Comments

@clawconduce
Copy link

If timeout or wait are not provided, options does not have a timeout set after this line:

https://github.com/mikaelbr/node-notifier/blob/master/notifiers/notificationcenter.js#L72

So if no timeout is provided to terminal-app, the property doesn't exist, and doesn't get passed to terminal-notifier. If it's not set, terminal-notifier never closes. Ideally, if neither wait or timeout are passed in, the value should be set to 5 so it gets set.

I can make a PR, but I am not sure if I should make this change only for the notificationcenter? I can put it in mapToMac or just before calling utils.fileCommandJson, or maybe it should go somewhere so all the notifiers set the default?

@adrienharnay
Copy link

hHy, any news on this? Still having memory leaks using jest's watch mode

@mikaelbr
Copy link
Owner

Hey! I think there should be some sort of default timeout in any case as there's no sticky support. So providing a timeout always would be smart. But it shouldn't have memory leaks anyhow. The terminal-notifier app (used by the package) should eventually quit and clear all memory usage (and should't use that much memory anyways). Sounds like a bug there

@mikaelbr
Copy link
Owner

If adding timeout like @clawconduce suggest works, we could do that as a temporary workaround

@SimenB
Copy link

SimenB commented Jan 24, 2019

If a timeout is needed, a PR adding that to Jest is most welcome. However, sane defaults in this module probably makes more sense? (if I've understood the issue correctly)

@mikaelbr
Copy link
Owner

Hey, sorry, I was talking about a default in node-notifier, yeah. Or more specifically, terminal-notifier should have had built in safety making this a non-issue. But I think it is more feasible to build a workaround into this project.

@mikaelbr
Copy link
Owner

Added some default timeout now. Can anyone who has observed this issue test the master branch?

@kevinelliott
Copy link

I do not ever see my notifications wait even when wait: true is passed in and no timeout defined. If I define something like timeout: 100 I never see it wait 100 seconds.

@jordan-mcrae
Copy link

jordan-mcrae commented Aug 1, 2019

Timeout is also not working for me on OSX 10.14.6.

Edit: Quick fix for anyone running into the same issue...

There's an open PR for setting timeout to false to fix this issue. The wait config option did not work for me, but this open PR did.

You can specify the PR branch in your package.json if you're strapped and need this to work immediately.

package.json entry:
"node-notifier": "https://github.com/jnielson94/node-notifier.git#overwritable-timeout"

MVP Example config:

const Notifier = require('node-notifier');

Notifier.notify({
  title   : 'Hello',
  message : 'World',
  timeout : false,
});

Link to PR: #271

@jnielson94
Copy link
Collaborator

v6 was released a few hours ago and includes the default timeout again (and the capability to overwrite that default using false as the timeout option). I'm going to go ahead and close this issue, but feel free to comment here (or open a new issue) if there's still problems with the timeouts.

@Crazie-ash
Copy link

Crazie-ash commented Oct 31, 2019

Is there any possibilities to change the default timeout from ~5secs to 100 secs....
I am not exactly sure about the correct configuration...
Any sample solutions, kindly let me know @jnielson94

Below is my sample:-

const Notifier = require('node-notifier');

Notifier.notify({
title : 'Hello',
message : 'World',
timeout : 100,
});

@jp185318
Copy link

I do not ever see my notifications wait even when wait: true is passed in and no timeout defined. If I define something like timeout: 100 I never see it wait 100 seconds.

hi, did u find a solution for this .

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

No branches or pull requests

9 participants