pinakes-server: propagate sync/share errors; cap unbounded pagination

limits

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I79339740dd34353014d02f571b6f55a26a6a6964
This commit is contained in:
raf 2026-03-07 16:55:43 +03:00
commit f049dd100a
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 37 additions and 15 deletions

View file

@ -862,7 +862,9 @@ pub async fn rename_media(
changed_by_device: None,
timestamp: chrono::Utc::now(),
};
let _ = state.storage.record_sync_change(&change).await;
if let Err(e) = state.storage.record_sync_change(&change).await {
tracing::warn!(error = %e, "failed to record sync change");
}
// Record audit
pinakes_core::audit::record_action(
@ -902,7 +904,9 @@ pub async fn move_media_endpoint(
changed_by_device: None,
timestamp: chrono::Utc::now(),
};
let _ = state.storage.record_sync_change(&change).await;
if let Err(e) = state.storage.record_sync_change(&change).await {
tracing::warn!(error = %e, "failed to record sync change");
}
// Record audit
pinakes_core::audit::record_action(
@ -958,7 +962,9 @@ pub async fn batch_move_media(
changed_by_device: None,
timestamp: chrono::Utc::now(),
};
let _ = state.storage.record_sync_change(&change).await;
if let Err(e) = state.storage.record_sync_change(&change).await {
tracing::warn!(error = %e, "failed to record sync change");
}
}
}
@ -1001,7 +1007,9 @@ pub async fn soft_delete_media(
changed_by_device: None,
timestamp: chrono::Utc::now(),
};
let _ = state.storage.record_sync_change(&change).await;
if let Err(e) = state.storage.record_sync_change(&change).await {
tracing::warn!(error = %e, "failed to record sync change");
}
// Record audit
pinakes_core::audit::record_action(
@ -1040,7 +1048,9 @@ pub async fn restore_media(
changed_by_device: None,
timestamp: chrono::Utc::now(),
};
let _ = state.storage.record_sync_change(&change).await;
if let Err(e) = state.storage.record_sync_change(&change).await {
tracing::warn!(error = %e, "failed to record sync change");
}
// Record audit
pinakes_core::audit::record_action(
@ -1139,7 +1149,9 @@ pub async fn permanent_delete_media(
changed_by_device: None,
timestamp: chrono::Utc::now(),
};
let _ = state.storage.record_sync_change(&change).await;
if let Err(e) = state.storage.record_sync_change(&change).await {
tracing::warn!(error = %e, "failed to record sync change");
}
// Clean up thumbnail
if let Some(ref thumb_path) = item.thumbnail_path