GRI-2150: create the client data directory before first write #287
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!287
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-2150-client-data-dir"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Store::open(crates/client/src/state.rs) createdclient.dbonly, never the data directory it lives in. On a fresh install the directory does not exist, so the first write (temporary file + rename) failed withNo such file or directoryand the device never reached the server — forge issue #284.opennow creates the data directory first,0700, viafs::DirBuilderwithrecursive(true). This covers every path the directory can come from:GRIMOIRIX_SIGNAGE_DATA_DIR,XDG_DATA_HOME, and the~/.local/share/grimoirix-signagedefault.Storeagainst a data directory that does not exist yet (the actual bug — the existinga_missing_file_is_a_first_starttest only covered a missingclient.dbinside a directory that already existed), and that the created directory is0700.Test plan
cargo test -p client --lib state::— 13 passed, including the two new tests../scripts/local-gates.sh --rust-only— every gate passed.Reviewed: cause and fix match the issue, tests cover it, CI green, up to date with dev.