rbowen opened a new issue, #9:
URL: https://github.com/apache/comdev/issues/9

   ## Summary
   
   When calling `search_list` with `quick=true`, the email rendering loop 
produces `undefined` for subject, from, and ID fields. Using `emails_only=true` 
instead works correctly.
   
   ## Steps to Reproduce
   
   1. Call `search_list` with parameters:
      - `list`: `dev`
      - `domain`: `iceberg.apache.org`
      - `timespan`: `lte=7d`
      - `quick`: `true`
   
   2. Observe that all email entries render as:
   ```
   - **undefined**
     From: undefined | Date: 2026-05-15 | ID: undefined
   ```
   
   3. For comparison, call the same endpoint with `emails_only=true` instead of 
`quick=true` — subjects, senders, and IDs are populated correctly.
   
   ## Expected Behavior
   
   Email fields (`subject`, `from`, `id`/`mid`) should be populated when 
rendering the emails section, or the emails section should be skipped entirely 
when `quick=true` (since the purpose of quick mode is to return stats only).
   
   ## Root Cause (Likely)
   
   In `index.js`, the email rendering code accesses `e.subject`, `e.from`, and 
`e.id || e.mid`. When PonyMail's `/api/stats.lua` responds in quick mode, it 
appears to return email objects with a different structure (or omits those 
fields entirely), resulting in `undefined` values.
   
   ## Suggested Fix
   
   Either:
   1. **Skip the emails section when `quick=true`** — since the caller is 
explicitly requesting stats-only, rendering empty emails is confusing.
   2. **Guard the email fields** — e.g. `e.subject || "(no subject)"` and 
similar fallbacks, and skip rendering entries where all fields are missing.
   
   Option 1 is simplest:
   ```javascript
   // In the search_list handler, after building stats:
   if (!quick && data.emails) {
     // render emails section
   }
   ```
   
   ## Environment
   
   - ponymail-mcp v1.0.0
   - MCP SDK ^1.12.1
   - PonyMail endpoint: https://lists.apache.org
   
   Disclaimer: AI-assisted triage using Amazon Quick.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to