-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address Telegram HTTP 500s when receiving message from Telegram in discussion group #3622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another possibility is to add an "update handler" for messages originating directly in a channel (not a discussion group). For these HTTP 500s that we are seeing, they occur when a message is sent from the official Telegram user directly in a channel, not the channel's discussion group.
Right now we're handling these updates w/ the apps.telegram.updates.update_handlers.channel_to_group_forward.ChannelToGroupForwardHandler
handler (this handler is determined here).
For now, what I've done in this PR seems like a simpler approach to arrive at the same solution, but open to thoughts/comments.
@pytest.fixture | ||
def client_with_user(): | ||
def _client_with_user(user): | ||
"""The client with logged in user""" | ||
|
||
client = APIClient() | ||
client.force_login(user) | ||
|
||
return client | ||
|
||
return _client_with_user | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't appear to be used anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
from rest_framework import status | ||
from rest_framework.test import APIClient | ||
|
||
url = reverse("telegram:incoming_webhook") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, I guess I would have this as a local var in each test initial setup
…scussion group (#3622) # Which issue(s) this PR fixes Closes #3621 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required)
Which issue(s) this PR fixes
Closes #3621
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)