fix: client save with --compression none stored lz4 instead of none

- server_compress was true when compression_type=None, telling server to
  recompress with its default (lz4) instead of storing raw
- compression_type query param was only sent when !server_compress,
  so 'none' was never sent to server
- Fix: server_compress always false in client mode (client handles all
  compression), compression_type always sent to server

Tested: save/get/list/info/filters/delete for lz4, none, gzip on both
local and client/server modes. All operations produce matching results.
This commit is contained in:
2026-03-15 12:46:29 -03:00
parent eca17b36ee
commit 0a3d61a875

View File

@@ -38,7 +38,9 @@ pub fn mode(
// Determine compression type from settings
let compression_type = settings_compression_type(cmd, settings);
let compression_type_str = compression_type.to_string();
let server_compress = matches!(compression_type, CompressionType::None);
// In client mode, the client always handles compression (even "none").
// The server should never re-compress client data.
let server_compress = false;
// Shared metadata collection: plugins write here via save_meta closure
let collected_meta: Arc<Mutex<HashMap<String, String>>> = Arc::new(Mutex::new(HashMap::new()));
@@ -124,14 +126,8 @@ pub fn mode(
("compress".to_string(), server_compress.to_string()),
("meta".to_string(), "false".to_string()),
("tags".to_string(), tags_clone.join(",")),
(
"compression_type".to_string(),
if !server_compress {
compression_type_str_clone
} else {
String::new()
},
),
// Always send compression_type when compress=false (client handled compression)
("compression_type".to_string(), compression_type_str_clone),
];
// Filter out empty params
let params: Vec<(String, String)> =