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
Event must be a string #2920
Event must be a string #2920
Conversation
posthog/tasks/process_event.py
Outdated
@@ -67,6 +67,8 @@ def _alias(previous_distinct_id: str, distinct_id: str, team_id: int, retry_if_f | |||
def store_names_and_properties(team: Team, event: str, properties: Dict) -> None: | |||
# In _capture we only prefetch a couple of fields in Team to avoid fetching too much data | |||
save = False | |||
if not isinstance(event, str) and not isinstance(event, bytes): | |||
raise TypeError("Event must be a string") |
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 won't be returned to the user submitting the event, it'll just show up in Sentry. If I think what I'd want for debugging purposes it'd be better if we just convert objects to strings (max 200 characters) so that I can at least see them come in and fix whatever happens, rather than have a silent failure.
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.
sure, updated!
@timgl this is good for another look. I'd merge directly due to your approval, but some things changed:
|
Changes
team.event_names
array.posthog.capture({ object: 'bla' })
.event_names
with something like:bytes
and not onlystr
, but we could only checkstr
here. I'm not sure what might come over the wire and if checking juststr
would break anything or not. I'm willing to change this, but might not be needed.Checklist