Forums Feature Requests Thread

[Enhancement] mobieusHelp: Orphaned method NotificationPrefs::shouldSendToAgent() — agent-scoped convenience wrapper never called

Patrick Bass · Jun 6 · 16 · 1 Locked
[Normal Priority] [Feature Enhancement] [Deployed to Production]
🚀 OP Jun 6, 2026 6:25pm

Area: mobieusHelp (audit p7) · Surface: platform/src/Services/Helpdesk/NotificationPrefs.php · Dimension: dead-code · Severity: minor

NotificationPrefs offers three send-gate helpers: shouldSend (generic), shouldSendToRequester (used in mailer), and shouldSendToAgent. The mailer never gates agent notifications through shouldSendToAgent — meaning agent-side notification preferences (the agent CHANNEL/event opt-out) are likely never honored on the send path. The wrapper is unreferenced.

Evidence

Definition at platform/src/Services/Helpdesk/NotificationPrefs.php:58 `public static function shouldSendToAgent(int $agentId, string $eventKey, string $channel = self::CHANNEL_EMAIL): bool`. Whole-repo grep: `grep -rn "shouldSendToAgent" /home/patrick/mobieus-io --include='*.php' | grep -v "function shouldSendToAgent"` => 0. The two siblings ARE used by HelpdeskMailer.php: shouldSend() and shouldSendToRequester() both appear in platform/src/Services/Helpdesk/HelpdeskMailer.php. Only the agent-scoped wrapper is dead.

Suggested fix. Either wire shouldSendToAgent() into HelpdeskMailer where agent recipients are notified (so agent notification prefs are actually respected), or remove it as dead code. Recommend the former — its absence is a latent functional gap, not just dead code.

Filed by the automated tenant-app audit and adversarially evidence-verified. Status: verified. Open — not yet actioned.


Patrick Bass
@mobieus

🚀 Jun 7, 2026 12:51pm

Shipped and deployed to production. Commit 63b2de429a.

NotificationPrefs::shouldSendToAgent() marked @deprecated + LogicException.

Closed as: deployed.


Patrick Bass
@mobieus

Log in or register to reply to this thread.