Skip to content

notificationListener's app() call hangs #2

@drewlustro

Description

@drewlustro

Hi, I am not sure what is causing this issue, but but the constructor always hangs due tonotificationListener(). I put in sanity logging throughout the code, and it appears to hang on this block:

let runLoop = () => {
  let pool = $.NSAutoreleasePool('alloc')('init');

  try {
      // ✅ GETS HERE OK (does next line take forever sometimes?)
      app('nextEventMatchingMask', $.NSAnyEventMask.toString(),
          'untilDate',             $.NSDate('distantFuture'),
          'inMode',                $.NSDefaultRunLoopMode,
          'dequeue',               1);
      //  ❌ FAILS TO GET HERE
  } catch(e) {
      // ❌ALSO FAILS TO GET HERE 
      errorCallback(e);
  }

  pool('drain');
  setTimeout(runLoop, 500);
}

Also, the code directly after including nowplaying never executes:

const nowplaying = require('nowplaying');
console.log('does not get here :( – assume constructor at fault?');

Basically, the built-in callbacks fire within setupNotifications, but I am never able to attach nowplaying.on() listeners in my main code because the constructor for NowPlaying locks the process execution.

I have tried the following versions of node:

  • v6.13.0 LTS
  • v7.10.1
  • v8.9.4 LTS

On macOS High Sierra 10.13.3 (17D102)


Is there possibly a missing library I need through brew? I have libffi. It spews a fair amount of warnings upon install, but it has worked fine for my ffmpeg installation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions