René's URL Explorer Experiment


Title: Safe Stop Propagation Propose · Issue #69 · hydrogram/hydrogram · GitHub

Open Graph Title: Safe Stop Propagation Propose · Issue #69 · hydrogram/hydrogram

X Title: Safe Stop Propagation Propose · Issue #69 · hydrogram/hydrogram

Description: Checklist I believe the idea is awesome and would benefit the framework I have searched in the issue tracker for similar requests, including closed ones Description When we want to ensure that a user marked as banned cannot interact, we ...

Open Graph Description: Checklist I believe the idea is awesome and would benefit the framework I have searched in the issue tracker for similar requests, including closed ones Description When we want to ensure that a us...

X Description: Checklist I believe the idea is awesome and would benefit the framework I have searched in the issue tracker for similar requests, including closed ones Description When we want to ensure that a us...

Opengraph URL: https://github.com/hydrogram/hydrogram/issues/69

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Safe Stop Propagation Propose","articleBody":"### Checklist\n\n- [x] I believe the idea is awesome and would benefit the framework\n- [x] I have searched in the issue tracker for similar requests, including closed ones\n\n### Description\n\nWhen we want to ensure that a user marked as banned cannot interact, we consider three things:\n\n1. Repeating code at the top of the handler function body to validate whether the user is banned. (It doesn't look nice, but you have control.)\n\n2. Using a decorator that performs the validations for you. (It's not much different from the first option; after all, you still repeat code above the functions, but you still have control.)\n\n3. Defining a handler with a higher group/priority and using `StopPropagation`. (It seems much more practical, BUT, if the handler unexpectedly breaks before you call `StopPropagation`, the banned user will bypass this validation layer; wrapping the entire function in a `try` will be necessary.)\n\n---\n\nI really like the third option, it would be interesting if we could define it as StopPropagation (to ensure that it does not propagate even if an error occurs) before validation, and after using CotinuePropagation, for example:\n\n```python\n\nasync def layer_check_user_banned(client: Client, message: Message):\n    user = ......\n    if user.banned:\n      raise StopPropagation\n\n@Client.on_message(group=-1)\nasync def setup(client: Client, message: Message):\n    await update.stop_propagation()\n\n    layers = (layer_check_user_banned, layer_check_user_has_username, .....)\n    for layer in layers:\n      await layer(client, message)\n\n    await update.continue_propagation()\n```\n----\nAlternatively I'm using decorators in these security layers to catch the error and rethrow it as `StopPropagation`:\n\n```python\ndef layer(function):\n    async def _decorator(*args, **kwargs):\n        try:\n            return await function(*args, **kwargs)\n        except StopPropagation:\n            raise\n        except Exception as e:\n            logging.error(\n                f'Layer {function.__name__!r} traceback:',\n                exc_info=e\n            )\n            raise StopPropagation\n    return _decorator\n```","author":{"url":"https://github.com/d3cryptofc","@type":"Person","name":"d3cryptofc"},"datePublished":"2025-07-13T22:50:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/69/hydrogram/issues/69"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:df8c05f3-84e3-5afa-6144-3d316a0218ff
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC4CE:67DD8:313CFE1:439D37E:6972B9C5
html-safe-nonce5e50eba17953bfa2e1666d8f7225b4448b8969662d3f1471265d5ba0ee4b0b55
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNENFOjY3REQ4OjMxM0NGRTE6NDM5RDM3RTo2OTcyQjlDNSIsInZpc2l0b3JfaWQiOiIxOTk5MzA2NjE2NjMyMTYyNzU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace2949f0ce1f3433c2b974c2b223ba9bbfc66f89eef668a7fcc3dbbed99afc6fa
hovercard-subject-tagissue:3226898937
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/hydrogram/hydrogram/69/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4fcb73e029c10f715527079f69ebcf0e1ef9365f0d76aa62129cbeb506a046ef/hydrogram/hydrogram/issues/69
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4fcb73e029c10f715527079f69ebcf0e1ef9365f0d76aa62129cbeb506a046ef/hydrogram/hydrogram/issues/69
og:image:altChecklist I believe the idea is awesome and would benefit the framework I have searched in the issue tracker for similar requests, including closed ones Description When we want to ensure that a us...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamed3cryptofc
hostnamegithub.com
expected-hostnamegithub.com
Noneaa656e37a6f46b81c2416d9c983f7c54e264ee31be17c0e6c9414b9f9f9c6eb4
turbo-cache-controlno-preview
go-importgithub.com/hydrogram/hydrogram git https://github.com/hydrogram/hydrogram.git
octolytics-dimension-user_id153278131
octolytics-dimension-user_loginhydrogram
octolytics-dimension-repository_id711555265
octolytics-dimension-repository_nwohydrogram/hydrogram
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id711555265
octolytics-dimension-repository_network_root_nwohydrogram/hydrogram
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
releasecd2db6550c3226c3d384891fd6e7c212a34667be
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues/69#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhydrogram%2Fhydrogram%2Fissues%2F69
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhydrogram%2Fhydrogram%2Fissues%2F69
Sign up https://patch-diff.githubusercontent.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=hydrogram%2Fhydrogram
Reloadhttps://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues/69
Reloadhttps://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues/69
Reloadhttps://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues/69
hydrogram https://patch-diff.githubusercontent.com/hydrogram
hydrogramhttps://patch-diff.githubusercontent.com/hydrogram/hydrogram
Please reload this pagehttps://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues/69
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fhydrogram%2Fhydrogram
Fork 46 https://patch-diff.githubusercontent.com/login?return_to=%2Fhydrogram%2Fhydrogram
Star 203 https://patch-diff.githubusercontent.com/login?return_to=%2Fhydrogram%2Fhydrogram
Code https://patch-diff.githubusercontent.com/hydrogram/hydrogram
Issues 14 https://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues
Pull requests 2 https://patch-diff.githubusercontent.com/hydrogram/hydrogram/pulls
Discussions https://patch-diff.githubusercontent.com/hydrogram/hydrogram/discussions
Actions https://patch-diff.githubusercontent.com/hydrogram/hydrogram/actions
Projects 0 https://patch-diff.githubusercontent.com/hydrogram/hydrogram/projects
Security 0 https://patch-diff.githubusercontent.com/hydrogram/hydrogram/security
Insights https://patch-diff.githubusercontent.com/hydrogram/hydrogram/pulse
Code https://patch-diff.githubusercontent.com/hydrogram/hydrogram
Issues https://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues
Pull requests https://patch-diff.githubusercontent.com/hydrogram/hydrogram/pulls
Discussions https://patch-diff.githubusercontent.com/hydrogram/hydrogram/discussions
Actions https://patch-diff.githubusercontent.com/hydrogram/hydrogram/actions
Projects https://patch-diff.githubusercontent.com/hydrogram/hydrogram/projects
Security https://patch-diff.githubusercontent.com/hydrogram/hydrogram/security
Insights https://patch-diff.githubusercontent.com/hydrogram/hydrogram/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/hydrogram/hydrogram/issues/69
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/hydrogram/hydrogram/issues/69
Safe Stop Propagation Proposehttps://patch-diff.githubusercontent.com/hydrogram/hydrogram/issues/69#top
enhancementNew feature, request or code enhancement.https://github.com/hydrogram/hydrogram/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/d3cryptofc
https://github.com/d3cryptofc
d3cryptofchttps://github.com/d3cryptofc
on Jul 13, 2025https://github.com/hydrogram/hydrogram/issues/69#issue-3226898937
enhancementNew feature, request or code enhancement.https://github.com/hydrogram/hydrogram/issues?q=state%3Aopen%20label%3A%22enhancement%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.