mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-04-26 22:35:51 +03:00
[PR #787] [MERGED] feat: optimize email filtering with frontend-only search #764
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cloudflare_temp_email#764
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/787
Author: @dreamhunter2333
Created: 12/14/2025
Status: ✅ Merged
Merged: 12/14/2025
Merged by: @dreamhunter2333
Base:
main← Head:feature/email📝 Commits (2)
e957b37feat: optimize email filtering with frontend-only searchcb90029fix: restore Mail ID query input in Index.vue📊 Changes
17 files changed (+489 additions, -546 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)➕
db/2025-12-15-message-id-index.sql(+4 -0)📝
db/schema.sql(+2 -0)📝
frontend/package.json(+1 -1)📝
frontend/pnpm-lock.yaml(+95 -87)📝
frontend/src/components/MailBox.vue(+41 -8)📝
frontend/src/views/Index.vue(+1 -1)📝
frontend/src/views/admin/Mails.vue(+2 -8)📝
frontend/src/views/user/UserMailBox.vue(+1 -7)📝
vitepress-docs/docs/en/guide/feature/mail-api.md(+10 -8)📝
vitepress-docs/docs/zh/guide/feature/mail-api.md(+10 -8)📝
vitepress-docs/package.json(+1 -1)📝
vitepress-docs/pnpm-lock.yaml(+26 -26)📝
worker/package.json(+3 -3)📝
worker/pnpm-lock.yaml(+284 -378)📝
worker/src/admin_api/admin_mail_api.ts(+3 -5)📝
worker/src/user_api/user_mail_api.ts(+3 -5)📄 Description
User description
Summary
优化邮件过滤性能,将后端关键词搜索改为前端当前页过滤,并添加数据库索引。
Optimize email filtering performance by moving keyword search from backend to frontend (current page only) and adding database index.
Changes
Backend
/admin/mails和/user_api/mails的keyword参数keywordparameter from/admin/mailsand/user_api/mailsAPIsFrontend
Database
message_id字段添加索引,优化更新操作性能message_idfield to optimize UPDATE performancedb/2025-12-15-message-id-index.sqldb/2025-12-15-message-id-index.sqlDocumentation
Performance Impact
Before: Backend
LIKE %keyword%query scanned 140k+ rows (unindexedrawTEXT field)After: Frontend filter on 20-100 items in-memory
Result: ~1000x faster for typical use cases ⚡
Migration Guide
If you are using the mail APIs with
keywordparameter:keywordfrom API callsaddress,created_atDatabase Migration
After merging, execute the migration SQL:
Test Plan
🤖 Generated with Claude Code
PR Type
Enhancement, Documentation, Bug fix
Description
Implement frontend-only email filtering for current page.
Remove backend keyword filtering from mail APIs (breaking change).
Add database index on
message_idto improve performance.Update API documentation and dependencies.
Changes walkthrough 📝
4 files
Add frontend filtering for current page emails.Remove backend keyword filtering in admin mail view.Remove backend keyword filtering in user mail view.Enable frontend filtering in main mailbox view.2 files
Remove keyword parameter from user mail API.Remove keyword parameter from admin mail API.2 files
Update dependencies for worker project.Update dependencies for documentation project.2 files
Update English documentation for mail API changes.Update Chinese documentation for mail API changes.7 files
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.