Set ClientNotification.type on every firmware notification (#12280)

* Set ClientNotification.type on every firmware notification

Every ClientNotification the firmware sends now carries the
NotificationType for its message, so clients can localize or act on it
without matching the text. `message` is unchanged.

The shared senders take the type as a required argument so a new call
site cannot omit it: PhoneAPI::sendNotification, AdminModule::sendWarning
/ sendWarningAndLog / queueChannelWarning, and RadioInterface's
sendErrorNotification. The channel-warning queue keeps the type of a
lone warning and uses CHANNEL_*_ISSUES for a coalesced one.
checkConfigRegion() gains an optional errType out-parameter so
validateConfigRegion() can send the reason's type.

NodeDB::notifyRefusedIdentity() (added in #12191) has no type yet and
stays UNSET until the protobufs add one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZVEy3QxYqj916trqLEsrb

* Fix AdminModule.h formatting

Move pendingWarningType below the aligned member block so clang-format
leaves the existing trailing-comment alignment alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZVEy3QxYqj916trqLEsrb

* Honor level in PhoneAPI::sendNotification; test catch-all types

sendNotification ignored its level argument and always sent WARNING.
Every caller passes WARNING today, so behavior is unchanged.

Add test_admin_radio cases for the CHANNEL_PSK_ISSUES and
CHANNEL_NAME_AND_PSK_ISSUES catch-all types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZVEy3QxYqj916trqLEsrb

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jonathan BennettandClaude Opus 5.5 authored and GitHub committed 2026-11-04 00:34:20 +00:00
1 parent 24c6e139dc
commit 51ac6ea7b7
18 files changed
+260 -61

No files matched your search

+2 -1
View File
@@ -414,7 +414,8 @@ void test_stream_api_finishes_pending_before_advancing_phone_api()
ScriptedStream stream;
StreamAPITestShim api(&stream);
api.sendConfigComplete();
api.sendNotification(meshtastic_LogRecord_Level_WARNING, 42, "still queued");
api.sendNotification(meshtastic_LogRecord_Level_WARNING, 42, "still queued",
meshtastic_ClientNotification_NotificationType_UNSET);
api.finishReady = false;
api.runOncePart(nullptr, 0);