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: github.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:42d72036-a2ee-5e0b-8474-d611df0b68f2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8FFA:209E7C:5124196:6E0649C:6973220B
html-safe-nonce4fe8e829a64aa3b04270c4574fee8a05e230126ee9383827de76e5d065470dbd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkZBOjIwOUU3Qzo1MTI0MTk2OjZFMDY0OUM6Njk3MzIyMEIiLCJ2aXNpdG9yX2lkIjoiNDEzNzkxOTEwODQ2NjU0OTI2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac66fd224554f5fc36392915daccd1a4cc65c67db9dd09f9146e1b03a7ec873d49
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
None44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4
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
releasea5e2b48bd1260476599758f5d253b5d24092ab84
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/hydrogram/hydrogram/issues/69#start-of-content
https://github.com/
Sign in https://github.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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhydrogram%2Fhydrogram%2Fissues%2F69
Sign up https://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=hydrogram%2Fhydrogram
Reloadhttps://github.com/hydrogram/hydrogram/issues/69
Reloadhttps://github.com/hydrogram/hydrogram/issues/69
Reloadhttps://github.com/hydrogram/hydrogram/issues/69
hydrogram https://github.com/hydrogram
hydrogramhttps://github.com/hydrogram/hydrogram
Please reload this pagehttps://github.com/hydrogram/hydrogram/issues/69
Notifications https://github.com/login?return_to=%2Fhydrogram%2Fhydrogram
Fork 46 https://github.com/login?return_to=%2Fhydrogram%2Fhydrogram
Star 203 https://github.com/login?return_to=%2Fhydrogram%2Fhydrogram
Code https://github.com/hydrogram/hydrogram
Issues 14 https://github.com/hydrogram/hydrogram/issues
Pull requests 2 https://github.com/hydrogram/hydrogram/pulls
Discussions https://github.com/hydrogram/hydrogram/discussions
Actions https://github.com/hydrogram/hydrogram/actions
Projects 0 https://github.com/hydrogram/hydrogram/projects
Security 0 https://github.com/hydrogram/hydrogram/security
Insights https://github.com/hydrogram/hydrogram/pulse
Code https://github.com/hydrogram/hydrogram
Issues https://github.com/hydrogram/hydrogram/issues
Pull requests https://github.com/hydrogram/hydrogram/pulls
Discussions https://github.com/hydrogram/hydrogram/discussions
Actions https://github.com/hydrogram/hydrogram/actions
Projects https://github.com/hydrogram/hydrogram/projects
Security https://github.com/hydrogram/hydrogram/security
Insights https://github.com/hydrogram/hydrogram/pulse
New issuehttps://github.com/login?return_to=https://github.com/hydrogram/hydrogram/issues/69
New issuehttps://github.com/login?return_to=https://github.com/hydrogram/hydrogram/issues/69
Safe Stop Propagation Proposehttps://github.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.