Fix search_list rendering "undefined" email fields when quick=true#14
Merged
Merged
Conversation
Fixes apache#9. In quick mode, PonyMail's /api/stats.lua returns email objects without subject/from/id, so the emails section rendered each entry as "- **undefined** From: undefined | ID: undefined". Quick mode is documented as stats-only (emails_only exists for email summaries), so skip the emails section entirely when quick=true. The subject/from/id fields are also guarded with fallbacks so a sparse entry never renders as "undefined". Verified live against dev@iceberg.apache.org (the reported repro): quick=true now returns stats only; emails_only=true still renders populated subjects, senders, and IDs. Generated-by: Claude Code 2.1.158 (Claude Opus 4.8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9.
In
quickmode, PonyMail's/api/stats.luareturns email objects withoutsubject/from/id, sosearch_list's emails loop rendered each entry as:quickis documented as stats-only (andemails_onlyexists for email summaries), so this skips the emails section entirely whenquick=true. Thesubject/from/idfields are also guarded with fallbacks ((no subject),(unknown sender),(no id)) so a sparse entry can never render asundefined.Verified live against
dev@iceberg.apache.org(the exact repro from the issue):quick=true→ now returns stats only (Hits: 76, archive range), no broken emails section.emails_only=true→ still renders populated subjects, senders, and IDs.Tests: 43/43 pass; prek clean.