Skip to content

Fix list_all_resend_emails: pagination cap, error handling, and empty-result caching#191

Merged
gregv merged 2 commits intofeature/resend-list-emails-apifrom
copilot/sub-pr-187-again
Mar 6, 2026
Merged

Fix list_all_resend_emails: pagination cap, error handling, and empty-result caching#191
gregv merged 2 commits intofeature/resend-list-emails-apifrom
copilot/sub-pr-187-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

Three correctness issues in list_all_resend_emails() addressed based on code review feedback.

What does the PR do?

  • Pagination cap raised + truncated flag added: max_pages increased from 10 → 100. Uses Python's for-else to set truncated=True only when the cap is actually hit. Flag is stored in Redis and surfaced in all response paths — callers can detect silently incomplete results.

  • Page error handling: Introduced page_error_occurred flag. On any mid-pagination exception, the function now returns success: False and skips caching entirely instead of writing and serving partial data for 5 minutes.

  • Empty-result caching: Removed if total_fetched > 0 guard — empty indexes are now cached with the same 300 s TTL, preventing repeated Resend API calls on accounts with no email history.

Type of change

  • Breaking Change
  • Bug Fix
  • New Feature

Linked Issue

Make sure you have

  • Pulled from the default branch
  • Documented your changes
  • Linked the Issue
  • Appointed a reviewer (if any)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ult caching

Co-authored-by: gregv <6913307+gregv@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Resend List Emails API for recipient-based status lookup Fix list_all_resend_emails: pagination cap, error handling, and empty-result caching Mar 6, 2026
Copilot finished work on behalf of gregv March 6, 2026 05:12
@gregv gregv marked this pull request as ready for review March 6, 2026 05:29
@gregv gregv merged commit 5cb0314 into feature/resend-list-emails-api Mar 6, 2026
3 checks passed
@gregv gregv deleted the copilot/sub-pr-187-again branch March 6, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants