fix: correct critical bugs and improve pipe streaming performance

Critical bug fixes:
- save_item now returns real Item from database, not a hardcoded fake
- AsyncDataService::save() reuses self.sync_service instead of creating redundant instance
- GenerateStatus trait signature mismatch fixed (CLI/API decoupling)

Performance improvements (pipe path untouched):
- CompressionEngine::open() returns Box<dyn Read + Send> enabling true streaming
- mode_get eliminates triple full-file read (was sampling then re-reading entire file)
- FilteringReader adds fast-path bypass when no filters, pre-allocates temp buffer
- text.rs meta plugin processes &[u8] slice directly, eliminates data.to_vec() clone

API correctness:
- Tag parse errors now return 400 instead of being silently discarded
- compute_diff uses similar crate (LCS-based) instead of naive positional comparison

Cleanup:
- Modernize string formatting (format!({x})) across codebase
- Remove redundant DB query in get mode
- Derive Debug/ToSchema on public types
- Delete placeholder test files with no real assertions
- Extract parse_comma_tags utility function
This commit is contained in:
2026-03-11 20:45:05 -03:00
parent e8ea42506e
commit 8a8a6e1c4b
53 changed files with 813 additions and 640 deletions

View File

@@ -251,14 +251,14 @@ pub fn process_metadata_outputs(
if let Some(mapping) = outputs.get(internal_name) {
// Check for null to disable the output
if mapping.is_null() {
debug!("META: Skipping disabled output (null): {}", internal_name);
debug!("META: Skipping disabled output (null): {internal_name}");
return None;
}
// Check for boolean false to disable the output
if let Some(false_val) = mapping.as_bool()
&& !false_val
{
debug!("META: Skipping disabled output: {}", internal_name);
debug!("META: Skipping disabled output: {internal_name}");
return None;
}
if let Some(custom_name) = mapping.as_str() {
@@ -279,8 +279,7 @@ pub fn process_metadata_outputs(
}
};
debug!(
"META: Processing metadata: internal_name={}, custom_name={}, value={}",
internal_name, custom_name, value_str
"META: Processing metadata: internal_name={internal_name}, custom_name={custom_name}, value={value_str}"
);
return Some(MetaData {
name: custom_name.to_string(),
@@ -307,10 +306,7 @@ pub fn process_metadata_outputs(
};
// Default: use internal name as output name
debug!(
"META: Processing metadata: name={}, value={}",
internal_name, value_str
);
debug!("META: Processing metadata: name={internal_name}, value={value_str}");
Some(MetaData {
name: internal_name.to_string(),
value: value_str,
@@ -507,5 +503,5 @@ pub fn get_meta_plugin(
}
// Fallback for unknown plugins
panic!("Meta plugin {:?} not registered", meta_plugin_type);
panic!("Meta plugin {meta_plugin_type:?} not registered");
}