From 19dbda80149f06a2ed143074ab5716d28d10aa98 Mon Sep 17 00:00:00 2001 From: pythontilk Date: Fri, 14 Nov 2025 23:21:05 +0100 Subject: [PATCH] fix: address CodeRabbit review findings for code quality and documentation - Add foreign key constraint to contacts table with CASCADE delete - Improve error handling in whisper-local example (remove unwrap, use expect) - Enhance LinuxInstallNotes.md with pnpm prerequisites, xhost security warnings, and professional tone - Fix misleading comment in audio test binary - Correct count mismatch (two -> three systems) --- LinuxInstallNotes.md | 13 +++++++++++-- crates/audio/src/bin/test_friendly_names.rs | 2 +- crates/db-user/src/contacts_migration.sql | 3 ++- crates/whisper-local/examples/test_model.rs | 8 ++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/LinuxInstallNotes.md b/LinuxInstallNotes.md index 24b5ffea6..4bd1a3081 100644 --- a/LinuxInstallNotes.md +++ b/LinuxInstallNotes.md @@ -4,7 +4,7 @@ **🎉 MAJOR UPDATES: Production-ready Linux support achieved!** -The Linux support has reached production-ready status with two critical systems fully implemented: +The Linux support has reached production-ready status with three critical systems fully implemented: ### ✅ Speaker Audio Capture (Fully Implemented) - **Full PulseAudio integration** via monitor sources for system audio capture @@ -33,7 +33,7 @@ The Linux support has reached production-ready status with two critical systems ## Install -My (work in progress) notes about installation on linux. +Work-in-progress notes for Linux installation. For some information see *CONTRIBUTING.md*. @@ -63,7 +63,16 @@ git clone https://github.com/fastrepl/hyprnote.git cd hyprnote +# Install pnpm if not already available (requires npm/node) +# npm install -g pnpm +# Or follow installation instructions at: https://pnpm.io/installation + # access the X Window System display without authentication +# WARNING: This relaxes X server access control for the current local user +# Only use when running GUI apps that require X11 access (e.g., from containers/sudo) +# Security: Grants local user processes GUI access; avoid on multi-user systems +# Revoke after use with: xhost -SI:localuser:$USER +# Alternative: Use Xauthority forwarding or run without privilege escalation xhost +SI:localuser:$USER # add virtual echo-cancel source to allow shared access diff --git a/crates/audio/src/bin/test_friendly_names.rs b/crates/audio/src/bin/test_friendly_names.rs index 6519540ac..ab7eb410c 100644 --- a/crates/audio/src/bin/test_friendly_names.rs +++ b/crates/audio/src/bin/test_friendly_names.rs @@ -1,7 +1,7 @@ use audio::AudioInput; fn main() { - // Initialize tracing if available, otherwise just print + // Print device enumeration diagnostics to stdout println!("Testing friendly device name enumeration...\n"); // Test microphone devices diff --git a/crates/db-user/src/contacts_migration.sql b/crates/db-user/src/contacts_migration.sql index 3c6336bdc..dc66455de 100644 --- a/crates/db-user/src/contacts_migration.sql +++ b/crates/db-user/src/contacts_migration.sql @@ -8,6 +8,7 @@ CREATE TABLE IF NOT EXISTS contacts ( organization TEXT, emails TEXT NOT NULL, phone_numbers TEXT NOT NULL, - note TEXT + note TEXT, + CONSTRAINT fk_contacts_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ); CREATE INDEX IF NOT EXISTS idx_contacts_user_id ON contacts(user_id); diff --git a/crates/whisper-local/examples/test_model.rs b/crates/whisper-local/examples/test_model.rs index d6a0026ba..908397df2 100644 --- a/crates/whisper-local/examples/test_model.rs +++ b/crates/whisper-local/examples/test_model.rs @@ -24,8 +24,12 @@ fn main() { } // Test with CPU only - let whisper = Whisper::builder() - .model_path(model_path.to_str().unwrap()) + let model_path_str = model_path + .to_str() + .expect("model path contains non-UTF-8 characters"); + + let _whisper = Whisper::builder() + .model_path(model_path_str) .build(); println!("Model initialized successfully!");