Self-echo filter for notify webhook (skip own-node messages) (#22)
CI / build + unit (push) Successful in 43s

This commit was merged in pull request #22.
This commit is contained in:
2026-09-25 08:51:03 +02:00
parent 3d0e369230
commit d3d1913b83
6 changed files with 88 additions and 3 deletions
+5
View File
@@ -434,6 +434,11 @@ export class MeshService implements OnModuleInit, OnModuleDestroy {
/** Fire-and-forget notify-webhook POST for an rx text on `channel` (no-op unless URL is set and channels match). */
private notifyRx(channel: number, text: string, from?: number): void {
if (this.notifyUrl && channel === this.notifyChannel) {
// self-echo filter: our own node must never trigger a notification of itself
if (from !== undefined && from === this.myNodeNum) {
this.logger.debug(`notify skipped: rx from our own node ${from}`);
return;
}
const body: Record<string, unknown> = { text };
if (from !== undefined) body.from = from;
void fetch(this.notifyUrl, {