René's URL Explorer Experiment


Title: Django backend retains automatically opened client after send failure · Issue #38 · ActiveCampaign/postmark-python · GitHub

Open Graph Title: Django backend retains automatically opened client after send failure · Issue #38 · ActiveCampaign/postmark-python

X Title: Django backend retains automatically opened client after send failure · Issue #38 · ActiveCampaign/postmark-python

Description: Describe the bug EmailBackend.send_messages closes a client it creates only when every batch succeeds. If send_batch raises, or a response contains a per-message failure, the backend retains the open client even when the caller did not e...

Open Graph Description: Describe the bug EmailBackend.send_messages closes a client it creates only when every batch succeeds. If send_batch raises, or a response contains a per-message failure, the backend retains the op...

X Description: Describe the bug EmailBackend.send_messages closes a client it creates only when every batch succeeds. If send_batch raises, or a response contains a per-message failure, the backend retains the op...

Opengraph URL: https://github.com/ActiveCampaign/postmark-python/issues/38

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Django backend retains automatically opened client after send failure","articleBody":"**Describe the bug**\n\n`EmailBackend.send_messages` closes a client it creates only when every batch succeeds. If `send_batch` raises, or a response contains a per-message failure, the backend retains the open client even when the caller did not explicitly open it. This affects both fail_silently settings.\n\n**To reproduce**\n\nWith Django settings configured locally:\n\n```python\nfrom unittest.mock import Mock, patch\nfrom django.core.mail import EmailMessage\nfrom postmark.django import EmailBackend\n\nclient = Mock()\nclient.outbound.send_batch.side_effect = RuntimeError(\"local failure\")\nwith patch(\"postmark.django.backend.SyncServerClient\", return_value=client):\n    backend = EmailBackend(server_token=\"local-test\", fail_silently=True)\n    backend.send_messages([\n        EmailMessage(\"example\", \"body\", \"sender@example.com\", [\"to@example.com\"])\n    ])\n    assert client.close.called  # false\n    assert backend.client is None  # false\n```\n\n**Expected behavior**\n\nClose automatically created clients on failure as well as success. Preserve an explicitly opened/caller-owned connection for reuse. Keep exception and fail_silently behavior unchanged.\n\n**Environment**\n- postmark-python 0.4.0 / current main\n- Python 3.12, Django 5.2, macOS\n\n**Additional context**\n\nThe send loop and close call can be wrapped in try/finally inside the existing exception-handling boundary. I plan to cover transport errors and API response failures, both ownership modes and both fail_silently settings. Local mocked transport only; no actual emails sent. AI assistance: OpenAI Codex.\n","author":{"url":"https://github.com/Kayvan-Zahiri","@type":"Person","name":"Kayvan-Zahiri"},"datePublished":"2026-10-23T23:57:21Z","url":"https://github.com/ActiveCampaign/postmark-python/issues/38"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:37aaf4ea-dcbc-491d-b94d-6e3625c5df23
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDFF4:2B4B16:351F4A:48A745:6AFE1DF9
html-safe-nonce5ad39d74e34b854161f330ff003a18ddaefc4b0eb4e0498129a8d4b6b774ec71
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERkY0OjJCNEIxNjozNTFGNEE6NDhBNzQ1OjZBRkUxREY5IiwidmlzaXRvcl9pZCI6IjQwMzE2NDAyNDU4MzIxMzAwNDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2ba02def5e20ff71222fa5c66d1174f27e88d8a681a72fd750f9e80153c28ae4
hovercard-subject-tagissue:6007232658
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ActiveCampaign/postmark-python/38/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e6db78dd16742fbc38ff4d4147392935353208b0fe660127d5fadaf06a6dba92/ActiveCampaign/postmark-python/issues/38
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e6db78dd16742fbc38ff4d4147392935353208b0fe660127d5fadaf06a6dba92/ActiveCampaign/postmark-python/issues/38
og:image:altDescribe the bug EmailBackend.send_messages closes a client it creates only when every batch succeeds. If send_batch raises, or a response contains a per-message failure, the backend retains the op...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameKayvan-Zahiri
hostnamegithub.com
expected-hostnamegithub.com
Noned0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9
turbo-cache-controlno-preview
go-importgithub.com/ActiveCampaign/postmark-python git https://github.com/ActiveCampaign/postmark-python.git
octolytics-dimension-user_id563440
octolytics-dimension-user_loginActiveCampaign
octolytics-dimension-repository_id1117725016
octolytics-dimension-repository_nwoActiveCampaign/postmark-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1117725016
octolytics-dimension-repository_network_root_nwoActiveCampaign/postmark-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasefef3993a71fa20f7be8e167132fbf9619bc66e12
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/ActiveCampaign/postmark-python/issues/38#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FActiveCampaign%2Fpostmark-python%2Fissues%2F38
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FActiveCampaign%2Fpostmark-python%2Fissues%2F38
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=ActiveCampaign%2Fpostmark-python
Reloadhttps://github.com/ActiveCampaign/postmark-python/issues/38
Reloadhttps://github.com/ActiveCampaign/postmark-python/issues/38
Reloadhttps://github.com/ActiveCampaign/postmark-python/issues/38
ActiveCampaignhttps://github.com/ActiveCampaign
postmark-pythonhttps://github.com/ActiveCampaign/postmark-python
Codehttps://github.com/ActiveCampaign/postmark-python
Issueshttps://github.com/ActiveCampaign/postmark-python/issues
Pull requests4 (4)https://github.com/ActiveCampaign/postmark-python/pulls
Actionshttps://github.com/ActiveCampaign/postmark-python/actions
Projectshttps://github.com/ActiveCampaign/postmark-python/projects
Wikihttps://github.com/ActiveCampaign/postmark-python/wiki
Security and qualityhttps://github.com/ActiveCampaign/postmark-python/security
Insightshttps://github.com/ActiveCampaign/postmark-python/insights
https://github.com/ActiveCampaign/postmark-python
New issuehttps://github.com/login?return_to=https://github.com/ActiveCampaign/postmark-python/issues/38
New issuehttps://github.com/login?return_to=https://github.com/ActiveCampaign/postmark-python/issues/38
#39https://github.com/ActiveCampaign/postmark-python/pull/39
Django backend retains automatically opened client after send failurehttps://github.com/ActiveCampaign/postmark-python/issues/38#top
#39https://github.com/ActiveCampaign/postmark-python/pull/39
bugSomething isn't workinghttps://github.com/ActiveCampaign/postmark-python/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/Kayvan-Zahiri
Kayvan-Zahirihttps://github.com/Kayvan-Zahiri
on Oct 23, 2026https://github.com/ActiveCampaign/postmark-python/issues/38#issue-6007232658
https://github.com/gregsvo
gregsvohttps://github.com/gregsvo
on Oct 28, 2026https://github.com/ActiveCampaign/postmark-python/issues/38#issuecomment-6478339581
@Kayvan-Zahirihttps://github.com/Kayvan-Zahiri
#39https://github.com/ActiveCampaign/postmark-python/pull/39
gregsvohttps://github.com/gregsvo
bugSomething isn't workinghttps://github.com/ActiveCampaign/postmark-python/issues?q=state%3Aopen%20label%3A%22bug%22
on Oct 28, 2026https://github.com/ActiveCampaign/postmark-python/issues/38#event-34511832089
gregsvohttps://github.com/gregsvo
completedhttps://github.com/ActiveCampaign/postmark-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#39https://github.com/ActiveCampaign/postmark-python/pull/39
on Oct 29, 2026https://github.com/ActiveCampaign/postmark-python/issues/38#event-34628650396
Sign up for freehttps://github.com/signup?return_to=https://github.com/ActiveCampaign/postmark-python/issues/38
Sign in to commenthttps://github.com/login?return_to=https://github.com/ActiveCampaign/postmark-python/issues/38
bugSomething isn't workinghttps://github.com/ActiveCampaign/postmark-python/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.