fix(server/client): rename document_id to id in DocumentUploadResponse, again
This commit is contained in:
parent
17f486a8b7
commit
1abfce88b9
|
|
@ -139,8 +139,8 @@ async fn debug_ocr_content() {
|
||||||
let doc1: DocumentUploadResponse = doc1_response.json().await.expect("Valid JSON for doc1");
|
let doc1: DocumentUploadResponse = doc1_response.json().await.expect("Valid JSON for doc1");
|
||||||
let doc2: DocumentUploadResponse = doc2_response.json().await.expect("Valid JSON for doc2");
|
let doc2: DocumentUploadResponse = doc2_response.json().await.expect("Valid JSON for doc2");
|
||||||
|
|
||||||
println!("📄 Document 1: {}", doc1.document_id);
|
println!("📄 Document 1: {}", doc1.id);
|
||||||
println!("📄 Document 2: {}", doc2.document_id);
|
println!("📄 Document 2: {}", doc2.id);
|
||||||
|
|
||||||
// Wait for OCR to complete
|
// Wait for OCR to complete
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
|
|
@ -158,7 +158,7 @@ async fn debug_ocr_content() {
|
||||||
// Check document 1
|
// Check document 1
|
||||||
if !doc1_completed {
|
if !doc1_completed {
|
||||||
let response = client
|
let response = client
|
||||||
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc1.document_id))
|
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc1.id))
|
||||||
.header("Authorization", format!("Bearer {}", token))
|
.header("Authorization", format!("Bearer {}", token))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
|
@ -180,7 +180,7 @@ async fn debug_ocr_content() {
|
||||||
// Check document 2
|
// Check document 2
|
||||||
if !doc2_completed {
|
if !doc2_completed {
|
||||||
let response = client
|
let response = client
|
||||||
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc2.document_id))
|
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc2.id))
|
||||||
.header("Authorization", format!("Bearer {}", token))
|
.header("Authorization", format!("Bearer {}", token))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
|
@ -212,14 +212,14 @@ async fn debug_ocr_content() {
|
||||||
|
|
||||||
// Now get the actual OCR content and analyze it
|
// Now get the actual OCR content and analyze it
|
||||||
let doc1_ocr_response = client
|
let doc1_ocr_response = client
|
||||||
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc1.document_id))
|
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc1.id))
|
||||||
.header("Authorization", format!("Bearer {}", token))
|
.header("Authorization", format!("Bearer {}", token))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
.expect("OCR endpoint should work");
|
.expect("OCR endpoint should work");
|
||||||
|
|
||||||
let doc2_ocr_response = client
|
let doc2_ocr_response = client
|
||||||
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc2.document_id))
|
.get(&format!("{}/api/documents/{}/ocr", get_base_url(), doc2.id))
|
||||||
.header("Authorization", format!("Bearer {}", token))
|
.header("Authorization", format!("Bearer {}", token))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ async fn investigate_empty_content_issue() {
|
||||||
let mut sample_results = Vec::new();
|
let mut sample_results = Vec::new();
|
||||||
|
|
||||||
for (i, doc) in uploaded_docs.iter().enumerate().take(3) { // Sample first 3 docs
|
for (i, doc) in uploaded_docs.iter().enumerate().take(3) { // Sample first 3 docs
|
||||||
let details = investigator.get_document_details(&doc.document_id.to_string()).await;
|
let details = investigator.get_document_details(&doc.id.to_string()).await;
|
||||||
let status = details["ocr_status"].as_str().unwrap_or("unknown");
|
let status = details["ocr_status"].as_str().unwrap_or("unknown");
|
||||||
let ocr_text = details["ocr_text"].as_str().unwrap_or("");
|
let ocr_text = details["ocr_text"].as_str().unwrap_or("");
|
||||||
let expected = &documents[i].0;
|
let expected = &documents[i].0;
|
||||||
|
|
@ -169,7 +169,7 @@ async fn investigate_empty_content_issue() {
|
||||||
current_completed += 1;
|
current_completed += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sample_results.push((doc.document_id.to_string(), status.to_string(), expected.clone(), ocr_text.to_string()));
|
sample_results.push((doc.id.to_string(), status.to_string(), expected.clone(), ocr_text.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Estimate total completed (this is rough but gives us an idea)
|
// Estimate total completed (this is rough but gives us an idea)
|
||||||
|
|
@ -207,7 +207,7 @@ async fn investigate_empty_content_issue() {
|
||||||
let mut other_corruption = 0;
|
let mut other_corruption = 0;
|
||||||
|
|
||||||
for (i, doc) in uploaded_docs.iter().enumerate() {
|
for (i, doc) in uploaded_docs.iter().enumerate() {
|
||||||
let details = investigator.get_document_details(&doc.document_id.to_string()).await;
|
let details = investigator.get_document_details(&doc.id.to_string()).await;
|
||||||
let status = details["ocr_status"].as_str().unwrap_or("unknown");
|
let status = details["ocr_status"].as_str().unwrap_or("unknown");
|
||||||
let ocr_text = details["ocr_text"].as_str().unwrap_or("");
|
let ocr_text = details["ocr_text"].as_str().unwrap_or("");
|
||||||
let expected = &documents[i].0;
|
let expected = &documents[i].0;
|
||||||
|
|
|
||||||
|
|
@ -426,7 +426,7 @@ async fn test_concurrent_ocr_processing() {
|
||||||
|
|
||||||
// Collect document IDs
|
// Collect document IDs
|
||||||
let document_ids: Vec<String> = documents.iter()
|
let document_ids: Vec<String> = documents.iter()
|
||||||
.map(|d| d.document_id.to_string())
|
.map(|d| d.id.to_string())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Monitor queue stats during processing
|
// Monitor queue stats during processing
|
||||||
|
|
|
||||||
|
|
@ -692,7 +692,7 @@ async fn test_system_stability_under_sustained_load() {
|
||||||
let content = format!("Stability test document {}", operation_counter);
|
let content = format!("Stability test document {}", operation_counter);
|
||||||
let filename = format!("stability_{}.txt", operation_counter);
|
let filename = format!("stability_{}.txt", operation_counter);
|
||||||
client.timed_upload(&content, &filename).await
|
client.timed_upload(&content, &filename).await
|
||||||
.map(|(doc, duration)| (format!("upload({})", doc.document_id), duration))
|
.map(|(doc, duration)| (format!("upload({})", doc.id), duration))
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// Search operation
|
// Search operation
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue