Fix config upgrade failures, save races, lock confirmation and release validation (#23)
* Coordinate config writes and gate releases on desktop validation * Use toolkit rc.2 with painting and session lock fixes * Ignore retired desktop widget settings in existing configs
This commit is contained in:
1 parent
a447136b01
commit
91e2f227d2
18 files changed
+536
-155
No files matched your search
@@ -1,4 +1,5 @@
|
||||
pub mod families;
|
||||
pub mod file;
|
||||
pub mod notifications;
|
||||
pub mod panel;
|
||||
pub mod presets;
|
||||
@@ -147,7 +148,8 @@ fn object(doc: &KdlDocument, parent: &str) -> Result<Map<String, Value>, Error>
|
||||
for node in doc.nodes() {
|
||||
let key = field(node.name().value(), parent);
|
||||
if parent.is_empty() && key == "desktop_widgets" {
|
||||
return Err(Error("Unknown configuration section: desktop-widgets".into()));
|
||||
// Retired widgets stay in the source for edits but have no runtime effect.
|
||||
continue;
|
||||
}
|
||||
let value = node_value(node, &key, parent)?;
|
||||
if is_records(&key, parent) {
|
||||
@@ -962,12 +964,16 @@ autostart "program" "two words" enabled=#false
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn removed_desktop_widgets_are_rejected_without_affecting_authored_metadata() {
|
||||
fn removed_desktop_widgets_are_ignored_without_affecting_authored_metadata() {
|
||||
for section in ["desktop-widgets", "desktop_widgets"] {
|
||||
let source = format!("{section} {{ clock {{ enabled #true; }}; }}");
|
||||
let error = Document::parse(&source).unwrap_err().to_string();
|
||||
assert!(error.contains("Unknown configuration section"), "{error}");
|
||||
assert!(crate::from_str::<serde_json::Value>(&source).is_err());
|
||||
let doc = Document::parse(&source).unwrap();
|
||||
assert!(doc.get("desktop_widgets").is_none());
|
||||
assert_eq!(doc.to_string(), source);
|
||||
assert_eq!(
|
||||
crate::from_str::<serde_json::Value>(&source).unwrap(),
|
||||
serde_json::json!({})
|
||||
);
|
||||
}
|
||||
assert!(Document::parse("panel main { metadata { desktop-widgets \"custom\"; }; }").is_ok());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user