fix: retry failed forwarded emails; only post-process successfully forwarded messages

Agent-Logs-Url: https://github.com/christianlouis/InboxConverge/sessions/e1fb16dc-0187-4ab9-901a-e0a76de64599

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-07 10:32:38 +00:00
committed by GitHub
parent af88176da4
commit ff7b50d944
5 changed files with 442 additions and 60 deletions
+3
View File
@@ -589,6 +589,7 @@ class TestProcessMailAccount:
session.refresh = AsyncMock()
mock_processor = AsyncMock()
mock_processor.post_process_messages = AsyncMock()
# Two emails: first succeeds, second fails
mock_processor.fetch_emails.return_value = (
[raw_email, raw_email],
@@ -612,6 +613,8 @@ class TestProcessMailAccount:
await process_mail_account.run(1)
assert session.commit.await_count >= 2
# Only the successfully forwarded UID should be post-processed
mock_processor.post_process_messages.assert_awaited_once_with(["uid-1"])
@pytest.mark.asyncio
async def test_gmail_credential_revocation_on_401(self):