How Meetily's NotificationManager Respects User Preferences for Recording Start/Stop Notifications
Meetily's NotificationManager validates user preferences against persisted settings in NotificationSettings before emitting recording lifecycle notifications, ensuring that recording start/stop alerts only appear when users explicitly enable both the global recording_notifications toggle and the specific event flags (show_recording_started or show_recording_stopped).
Meetily, an open-source meeting assistant built by Zackriya-Solutions, implements a robust preference-aware notification pipeline in its Tauri-based desktop application. The NotificationManager ensures that recording start/stop notifications respect granular user controls by validating multiple consent layers before dispatching alerts to the operating system.
How NotificationSettings Stores User Preferences
User notification preferences are persisted in frontend/src-tauri/src/notifications/settings.rs, where the NotificationSettings struct maintains granular control over recording lifecycle events. According to the Meetily source code at lines 10-15, this structure includes a global recording_notifications flag alongside fine-grained toggles for specific events.
The settings distinguish between:
recording_notifications: The master switch that enables or disables all recording-related notificationsshow_recording_started: Controls whether the "Recording started" alert appears when capture beginsshow_recording_stopped: Determines if the "Recording stopped" confirmation displays when capture ends
These preferences are serialized to notifications.json on disk and loaded into memory when the application initializes, ensuring that user choices persist across sessions.
The Validation Flow in NotificationManager
The NotificationManager in frontend/src-tauri/src/notifications/manager.rs serves as the central coordinator that enforces user preferences. According to the source code implementation at lines 80-85, the show_notification method implements a strict validation chain that short-circuits early if any consent check fails.
The Four-Layer Consent Check
Before displaying any recording notification, the manager validates:
- User consent: Has the user granted overall permission for notifications?
- System permissions: Are OS-level notification permissions granted?
- Do-Not-Disturb state: Is DND active, and if so, does the notification priority override it?
- Specific preferences: Are both
recording_notificationsand the event-specific flag (show_recording_startedorshow_recording_stopped) set totrue?
If any layer returns false, the method returns Ok(()) silently, preventing the notification from reaching the system dispatcher.
Recording-Specific Evaluation
When processing recording events, the manager specifically checks for NotificationType::RecordingStarted or NotificationType::RecordingStopped. The logic evaluates the boolean expression self.settings.recording_notifications && matches!(notification.notification_type, ...) to ensure both the global toggle and specific event preference are enabled before proceeding to system.rs.
Platform Dispatch and DND Handling
The final dispatch layer resides in frontend/src-tauri/src/notifications/system.rs, which handles platform-specific notification delivery. As implemented at lines 25-30, this module respects the DND decision made by the manager through the should_respect_dnd parameter, skipping non-critical notifications when Do-Not-Disturb mode is active on the operating system.
This separation of concerns ensures that the manager handles business logic (user preferences) while the system layer handles platform integration, with both respecting the DND state determined during the validation phase.
Code Implementation Examples
When the UI triggers a recording event, the flow moves from TypeScript commands through Rust implementations that instantiate Notification objects and pass them through the preference validation chain.
Frontend Command Invocation
The frontend invokes Tauri commands that eventually call the notification manager:
// Frontend – request a recording‑started notification
import { invoke } from '@tauri-apps/api/tauri';
// This triggers the Rust command which internally uses the manager
await invoke('show_recording_started_notification', {
meetingName: 'Daily Stand‑up'
});
Rust Command Implementation
The Rust command constructs a typed notification and delegates to the manager:
// Rust – building and dispatching a recording‑started notification
use crate::notifications::{
manager::NotificationManager,
types::{Notification, NotificationType},
};
pub async fn show_recording_started_notification(
manager: &NotificationManager,
meeting_name: &str,
) -> Result<()> {
let notification = Notification::new(
format!("Recording started: {}", meeting_name),
"Your meeting is now being recorded.",
NotificationType::RecordingStarted,
);
manager.show_notification(notification).await
}
Preference Validation Logic
The show_notification method in NotificationManager demonstrates the explicit preference checks:
// In NotificationManager (simplified)
pub async fn show_notification(&self, notification: Notification) -> Result<()> {
if !self.settings.should_show_notifications().await {
return Ok(()); // consent/permission/DND failures
}
// Respect user‑level recording preferences
if self.settings.recording_notifications
&& matches!(notification.notification_type,
NotificationType::RecordingStarted | NotificationType::RecordingStopped)
{
self.system.show_notification(notification).await?;
}
Ok(())
}
Key Files in the Notification Pipeline
| Component | File Path | Purpose |
|---|---|---|
| Notification Types | frontend/src-tauri/src/notifications/types.rs |
Defines Notification, NotificationType, and helper constructors like recording_started() |
| User Settings | frontend/src-tauri/src/notifications/settings.rs |
Persists user preferences including recording_notifications, show_recording_started, and show_recording_stopped |
| Central Coordinator | frontend/src-tauri/src/notifications/manager.rs |
Implements the show_notification decision flow that validates preferences at lines 80-85 |
| System Dispatcher | frontend/src-tauri/src/notifications/system.rs |
Sends platform-specific notifications and checks DND at lines 25-30 |
| Command Interface | frontend/src-tauri/src/notifications/commands.rs |
Exposes Tauri commands that UI code calls to trigger notifications |
Summary
- Meetily stores recording notification preferences in
NotificationSettingswith granular control viarecording_notifications,show_recording_started, andshow_recording_stoppedflags. - The NotificationManager validates four consent layers—user consent, system permissions, DND state, and specific event preferences—before emitting any alert.
- Recording notifications only dispatch when both the global toggle and event-specific flag evaluate to
true, as implemented inmanager.rslines 80-85. - The system.rs dispatcher respects DND decisions made upstream and handles platform-specific delivery at lines 25-30.
- Preferences persist to
notifications.jsonand reload on application startup, ensuring consistent behavior across sessions.
Frequently Asked Questions
How does Meetily handle Do-Not-Disturb mode when recording starts?
Meetily's NotificationManager checks if Do-Not-Disturb is active as part of its four-layer validation in manager.rs. If DND is enabled and the recording notification lacks priority override privileges, the manager returns early and prevents the alert from reaching system.rs, effectively suppressing the notification until DND is disabled.
Where are recording notification preferences stored in Meetily?
User preferences are persisted in a local notifications.json file and represented in memory by the NotificationSettings struct defined in frontend/src-tauri/src/notifications/settings.rs. This includes boolean flags for recording_notifications, show_recording_started, and show_recording_stopped that control granular display behavior.
What happens if a user disables recording notifications after a meeting starts?
If a user toggles recording_notifications or show_recording_started to false during an active session, the NotificationManager will immediately respect the updated preference. Subsequent calls to show_notification will validate against the current settings stored in memory and silently discard any recording lifecycle alerts that no longer meet the criteria.
Can users enable notifications for recording start but disable them for recording stop?
Yes, Meetily supports independent control through separate boolean flags. The show_recording_started and show_recording_stopped preferences in settings.rs allow users to mix and match which lifecycle events generate alerts, provided the master recording_notifications toggle remains enabled.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →