fix(nextcloud-talk): keep startAccount pending until abort (#27897)

This commit is contained in:
Peter Steinberger
2026-02-26 22:00:25 +00:00
parent b1bbf3fff1
commit 31c0b04c49
4 changed files with 142 additions and 3 deletions

View File

@@ -276,12 +276,25 @@ export function createNextcloudTalkWebhookServer(opts: NextcloudTalkWebhookServe
});
};
let stopped = false;
const stop = () => {
server.close();
if (stopped) {
return;
}
stopped = true;
try {
server.close();
} catch {
// ignore close races while shutting down
}
};
if (abortSignal) {
abortSignal.addEventListener("abort", stop, { once: true });
if (abortSignal.aborted) {
stop();
} else {
abortSignal.addEventListener("abort", stop, { once: true });
}
}
return { server, start, stop };
@@ -384,7 +397,14 @@ export async function monitorNextcloudTalkProvider(
abortSignal: opts.abortSignal,
});
if (opts.abortSignal?.aborted) {
return { stop };
}
await start();
if (opts.abortSignal?.aborted) {
stop();
return { stop };
}
const publicUrl =
account.config.webhookPublicUrl ??