mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-26 08:11:04 +00:00
Merge #3067
3067: Fix task details serialization r=Kerollmops a=ManyTheFish # Pull Request - document addition task details always contain the field `indexedDocuments` - value is set to `null` when the task is enqueued or processing - value is set to `0` when the task is canceled or failed - the field `deletedDocuments` of the document deletion task details is set to `0` when the task is canceled or failed - the field `deletedDocuments` of the document clearAll task details is set to `0` when the task is canceled or failed - the field `deletedTasks` of the task deletion task details is set to `0` when the task is canceled or failed - the field `canceledTasks` of the task cancelation task details is set to `0` when the task is canceled or failed ## Related issue Fixes #3057 Fixes #3058 Co-authored-by: ManyTheFish <many@meilisearch.com>
This commit is contained in:
@ -82,7 +82,7 @@ pub struct DetailsView {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub received_documents: Option<u64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub indexed_documents: Option<u64>,
|
||||
pub indexed_documents: Option<Option<u64>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub primary_key: Option<Option<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -112,7 +112,7 @@ impl From<Details> for DetailsView {
|
||||
Details::DocumentAdditionOrUpdate { received_documents, indexed_documents } => {
|
||||
DetailsView {
|
||||
received_documents: Some(received_documents),
|
||||
indexed_documents,
|
||||
indexed_documents: Some(indexed_documents),
|
||||
..DetailsView::default()
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ async fn test_summarized_delete_batch() {
|
||||
"canceledBy": null,
|
||||
"details": {
|
||||
"matchedDocuments": 3,
|
||||
"deletedDocuments": null
|
||||
"deletedDocuments": 0
|
||||
},
|
||||
"error": {
|
||||
"message": "Index `test` not found.",
|
||||
@ -471,7 +471,7 @@ async fn test_summarized_delete_document() {
|
||||
"canceledBy": null,
|
||||
"details": {
|
||||
"matchedDocuments": 1,
|
||||
"deletedDocuments": null
|
||||
"deletedDocuments": 0
|
||||
},
|
||||
"error": {
|
||||
"message": "Index `test` not found.",
|
||||
|
Reference in New Issue
Block a user