# 🔄 Cache Cleared - Test Again

## Actions Taken

### 1. Cleared Cached PDFs
```bash
rm -f /tmp/aumentum_pdfs/PL11089*
```

**Why:** Old cached PDFs might contain wrong images from before the fix

### 2. Restarted API
```bash
pkill -f aumentum_api
python3 aumentum_api.py
```

**Why:** Ensure latest code is running

---

## 🧪 Test Steps for UI

### Step 1: Clear Browser Cache

**In your browser:**
1. Press `Ctrl+Shift+Del` (or `Cmd+Shift+Del` on Mac)
2. Clear "Cached images and files"
3. Time range: "All time"
4. Click "Clear data"

### Step 2: Reload Extension

**In Chrome/Edge:**
1. Go to `chrome://extensions/`
2. Find "Plagis Aumentum Extension"
3. Click the refresh icon
4. Or toggle it off/on

### Step 3: Test PL11089

1. Open extension popup
2. Search for `PL11089`
3. Click "View 46-Page Document" for Property File (Type 103)
4. **Check browser console logs** (F12)
5. Look for the API URL being called

**Expected URL:**
```
http://localhost:8001/documents/pdf-by-document-number?
  document_number=PL11089
  &document_id=10000000013791
  &document_type=103
```

### Step 4: Check API Logs

```bash
tail -f /home/plagis/workspace/plagis_aumentum/api.log
```

**Look for:**
- ✅ "Using ACTUAL upload date from content_url"
- ✅ "Content URL date: 2015-03-26"
- ✅ "Searching reference directory: 15/8"
- ✅ "Found 49 sequential files starting from reference"
- ✅ "Reference file IS at position 1"

---

## 🔍 Debugging if Still Wrong

If you STILL see PL6982 images:

### Check 1: Verify API Response
```bash
curl "http://localhost:8001/documents/by-document-number?document_number=PL11089" \
  | python3 -m json.tool \
  | grep available_images
```

**Expected:**
```
"available_images": 1
"available_images": 46
"available_images": 2
```

### Check 2: Check First Image UUID
```bash
python3 -c "
from aumentum_browser_service import AumentumBrowserService, DEFAULT_DB_CONFIG, DEFAULT_CONTENTSTORE_BASE
service = AumentumBrowserService(DEFAULT_DB_CONFIG, DEFAULT_CONTENTSTORE_BASE)
results = service.resolve_store_urls_by_document_number('PL11089')
if results[0]['images']:
    url = results[0]['images'][0]['content_url']
    print(f'First image: {url}')
    print(f'Should contain: 3eee6f3f-0b98-41b9-a6cb-2c4488152fed')
"
```

### Check 3: Manually Test PDF Generation
```bash
curl "http://localhost:8001/documents/pdf-by-document-number?document_number=PL11089&document_id=10000000013791" \
  -o /tmp/test_pl11089.pdf

# Then open /tmp/test_pl11089.pdf and verify content
```

---

## 📋 Checklist

- [ ] Cleared `/tmp/aumentum_pdfs/PL11089*`
- [ ] Restarted API
- [ ] Cleared browser cache
- [ ] Reloaded browser extension
- [ ] Tested PL11089 in UI
- [ ] Checked browser console (F12)
- [ ] Checked API logs
- [ ] Verified first image UUID

---

## 🎯 What to Look For

**If working correctly:**
- First image UUID: `3eee6f3f-0b98-41b9-a6cb-2c4488152fed`
- From directory: `2015/3/26/15/8`
- Type 103 shows: 46 images
- Content: Actually PL11089 (not PL6982)

**If still wrong:**
- Check which URL the browser extension is calling
- Check API logs for what it's returning
- Verify no old code is being cached

---

**Try testing again now with cache cleared!** 🔄

