fix(desktop): drop -w — SnoreToast waits by default; -w made it fail (exit -1)

Testing showed SnoreToast blocks/waits for the toast interaction when given -pipeName; the
-w flag actually fails on this build (exit -1) which forced the reply-less fallback. Without
-w it waits, captures the typed reply, and writes it to our pipe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 08:43:40 +05:30
parent 0f5e5bf00a
commit 0b58d33117
+4 -4
View File
@@ -72,9 +72,9 @@ function snoreExe() {
} catch (_) {}
return null;
}
// Direct SnoreToast with -w so it waits and writes the reply to our pipe. Rejects if the binary
// is missing or fails to show a toast (so the caller can fall back). Args match node-notifier's
// known-good set + -w (no -application, which broke the toast).
// Direct SnoreToast: with -pipeName it blocks and waits for the interaction on its own, then
// writes the result (incl. the typed reply) to our pipe (do NOT pass -w — it fails on this
// build; and no -application). Rejects if the binary is missing/fails so the caller can fall back.
function directToast(payload, img) {
return new Promise((resolve, reject) => {
const exe = snoreExe();
@@ -85,7 +85,7 @@ function directToast(payload, img) {
server = net.createServer((sock) => { sock.on('data', (d) => { raw = Buffer.concat([raw, d]); }); });
server.on('error', (e) => settle(reject, e));
server.listen(pipe, () => {
const args = ['-appID', APP_ID, '-tb', '-w', '-pipeName', pipe];
const args = ['-appID', APP_ID, '-tb', '-pipeName', pipe];
if (img) args.push('-p', img);
args.push('-m', payload.body || ' ', '-t', payload.title || 'Biz Connect');
const child = spawn(exe, args, { windowsHide: true });