Skip to content

[Audit][Medium] InputSettings.saveFromMapper silently swallows errors from persistence.save #723

@MichaelFisher1997

Description

@MichaelFisher1997

🔍 Module Scanned\n (automated audit scan)\n\n## 📝 Summary\nThe function creates a temporary instance and attempts to save settings to disk, but uses to silently swallow any errors from . This means disk full errors, permission errors, or any other I/O failures during save go completely undetected, and the user receives no feedback about why their settings weren't persisted.\n\n\n## 📍 Location\n- File: \n- Function/Scope: \n\n\n## 🔴 Severity: Medium\n- Critical: N/A\n- High: N/A \n- Medium: Silent error swallowing means failed saves go undetected with no user feedback\n- Low: N/A\n\n## 💥 Impact\nWhen is called (e.g., via at app shutdown or when saving input bindings), if the settings file cannot be written due to disk full, permissions, or other I/O errors, the error is silently discarded. Users may believe their settings were saved when they were not, leading to:\n- Lost custom keybindings on next launch\n- Lost input configuration changes\n- Confusion about why settings reverted\n\n## 🔎 Evidence\n\n\nThe caller in :\n\n\nNotice that properly logs errors from input settings save via . However, itself swallows errors internally with before returning, so always receives and never logs anything.\n\n## 🛠️ Proposed Fix\nRemove the and let errors propagate to the caller:\n\n\n\nThis way the caller () receives the error and can properly log it.\n\n## ✅ Acceptance Criteria\n- [ ] propagates errors from to its caller\n- [ ] receives and logs errors when input settings save fails\n- [ ] No empty blocks in the save path\n- [ ] passes\n\n## 📚 References\n- Zig error handling pattern: https://ziglang.org/documentation/0.16/#Error-Handling\n- - caller that properly handles errors but is bypassed by internal

Metadata

Metadata

Assignees

No one assigned

    Labels

    automated-auditIssues found by automated opencode audit scansbugSomething isn't workingdocumentationImprovements or additions to documentationhotfixquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions