Yasiru Rangana
e70cf8d38a
fix: use DocStatus.PROCESSED enum instead of hardcoded uppercase string
## Problem
Status comparisons used hardcoded uppercase string "PROCESSED" which
didn't match LightRAG's DocStatus enum that stores lowercase "processed".
This caused text_processed to always return False even when documents
were successfully processed.
**Evidence:**
- LightRAG's DocStatus enum (lightrag/base.py): PROCESSED = "processed"
- RAGAnything's DocStatus enum (raganything/base.py:11): PROCESSED = "processed"
- Current code checked: doc_status == "PROCESSED" (uppercase) ❌
- Actual value from LightRAG: "processed" (lowercase) ✓
**Impact:**
- is_document_fully_processed() always returned False
- get_document_processing_status() showed text_processed as False
- Multimodal processing logic incorrectly detected status
## Solution
Replace hardcoded string literals with DocStatus.PROCESSED enum constant
(already imported at line 14).
**Changes:**
- Line 481: doc_status == "PROCESSED" → DocStatus.PROCESSED
- Line 486: doc_status == "PROCESSED" → DocStatus.PROCESSED
- Line 1355: doc_status.get("status") == "PROCESSED" → DocStatus.PROCESSED
- Line 1387: doc_status.get("status") == "PROCESSED" → DocStatus.PROCESSED
- Updated comments (lines 463, 478) for consistency
**Benefits:**
1. ✅ Fixes case mismatch bug - enum auto-converts to lowercase
2. ✅ Type-safe - IDE/linter catches errors
3. ✅ Maintainable - single source of truth (no magic strings)
4. ✅ Future-proof - if enum changes, code updates automatically
5. ✅ Follows Python best practices
**Compatibility:**
- Works with LightRAG v1.4.9.2+
- Compatible with LightRAG v1.4.9.3 (which added PREPROCESSED status)
- No breaking changes
**References:**
- LightRAG DocStatus: lightrag/base.py
- RAGAnything DocStatus: raganything/base.py:11
- Related: LightRAG v1.4.9.3 added PREPROCESSED = "multimodal_processed"
2025-10-19 23:36:54 +11:00
..
2025-09-01 15:39:34 +08:00
2025-09-01 21:57:31 +08:00
2025-07-24 14:20:50 +05:30
2025-07-24 15:07:33 +05:30
2025-07-21 23:48:27 +08:00
2025-07-28 10:08:54 +05:30
2025-09-16 11:31:35 +08:00
2025-09-22 10:42:35 +08:00
2025-10-19 23:36:54 +11:00
2025-07-04 21:05:22 +08:00
2025-09-16 11:10:26 +08:00
2025-10-04 21:26:59 +07:00
2025-09-02 16:38:41 +08:00