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 (_) {} } catch (_) {}
return null; return null;
} }
// Direct SnoreToast with -w so it waits and writes the reply to our pipe. Rejects if the binary // Direct SnoreToast: with -pipeName it blocks and waits for the interaction on its own, then
// is missing or fails to show a toast (so the caller can fall back). Args match node-notifier's // writes the result (incl. the typed reply) to our pipe (do NOT pass -w — it fails on this
// known-good set + -w (no -application, which broke the toast). // build; and no -application). Rejects if the binary is missing/fails so the caller can fall back.
function directToast(payload, img) { function directToast(payload, img) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const exe = snoreExe(); 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 = net.createServer((sock) => { sock.on('data', (d) => { raw = Buffer.concat([raw, d]); }); });
server.on('error', (e) => settle(reject, e)); server.on('error', (e) => settle(reject, e));
server.listen(pipe, () => { 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); if (img) args.push('-p', img);
args.push('-m', payload.body || ' ', '-t', payload.title || 'Biz Connect'); args.push('-m', payload.body || ' ', '-t', payload.title || 'Biz Connect');
const child = spawn(exe, args, { windowsHide: true }); const child = spawn(exe, args, { windowsHide: true });