From 6a3ed5d430f35e4f2a7a040d14d1ff35dbc3a76b Mon Sep 17 00:00:00 2001 From: agessaman Date: Mon, 11 May 2026 16:22:29 -0700 Subject: [PATCH] Update AlertReporter to include path hash size in flood messages Modified the sendFlood method in AlertReporter to incorporate path hash size, ensuring compatibility with the repeater's configured path.hash.mode. This change enhances the handling of alert floods by accommodating different regional mesh configurations. --- src/helpers/AlertReporter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/helpers/AlertReporter.cpp b/src/helpers/AlertReporter.cpp index 19082f9b..356c7aac 100644 --- a/src/helpers/AlertReporter.cpp +++ b/src/helpers/AlertReporter.cpp @@ -214,15 +214,20 @@ bool AlertReporter::sendChannel(const char* text) { // broadcast channel messages. Falls back to plain (unscoped) flood when // no callbacks are wired or no scope is configured, matching the // pre-scoped behavior on builds without RegionMap. + // + // path_hash_size must honor the repeater's configured path.hash.mode (1, 2, + // or 3-byte hashes); the Mesh.h default of 1 would silently downgrade + // observers running on 2/3-byte regional meshes. + const uint8_t path_hash_size = (uint8_t)(_prefs->path_hash_mode + 1); TransportKey scope; bool have_scope = _callbacks && _callbacks->resolveAlertScope(scope) && !scope.isNull(); if (have_scope) { uint16_t codes[2]; codes[0] = scope.calcTransportCode(pkt); codes[1] = 0; - _mesh->sendFlood(pkt, codes); + _mesh->sendFlood(pkt, codes, 0, path_hash_size); } else { - _mesh->sendFlood(pkt); + _mesh->sendFlood(pkt, 0, path_hash_size); } ALERT_DEBUG_PRINTLN("sent: %s", text); return true;