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
-
Call search_list with parameters:
list: dev
domain: iceberg.apache.org
timespan: lte=7d
quick: true
-
Observe that all email entries render as:
- **undefined**
From: undefined | Date: 2026-05-15 | ID: undefined
- 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:
- Skip the emails section when
quick=true — since the caller is explicitly requesting stats-only, rendering empty emails is confusing.
- 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:
// In the search_list handler, after building stats:
if (!quick && data.emails) {
// render emails section
}
Environment
Disclaimer: AI-assisted triage using Amazon Quick.
Summary
When calling
search_listwithquick=true, the email rendering loop producesundefinedfor subject, from, and ID fields. Usingemails_only=trueinstead works correctly.Steps to Reproduce
Call
search_listwith parameters:list:devdomain:iceberg.apache.orgtimespan:lte=7dquick:trueObserve that all email entries render as:
emails_only=trueinstead ofquick=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 whenquick=true(since the purpose of quick mode is to return stats only).Root Cause (Likely)
In
index.js, the email rendering code accessese.subject,e.from, ande.id || e.mid. When PonyMail's/api/stats.luaresponds in quick mode, it appears to return email objects with a different structure (or omits those fields entirely), resulting inundefinedvalues.Suggested Fix
Either:
quick=true— since the caller is explicitly requesting stats-only, rendering empty emails is confusing.e.subject || "(no subject)"and similar fallbacks, and skip rendering entries where all fields are missing.Option 1 is simplest:
Environment
Disclaimer: AI-assisted triage using Amazon Quick.