Skip to content
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

Check if data["content"] is a dict before using it as a dict #362

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

c-cal
Copy link
Contributor

@c-cal c-cal commented Mar 8, 2024

Fix #363

image

When notification does not contain the "content" field, then None is used by default:

self.content: Optional[Dict[str, Any]] = notif.get("content")

This happens with pusher that have the attribute data.format: event_id_only, such as Element Android (https://github.com/element-hq/element-android/blob/develop/vector/src/main/java/im/vector/app/core/pushers/PushersManager.kt#L85), or when Synapse is configured with push.include_content: false.

Signed-off-by: Charlie Calendre

@c-cal c-cal requested a review from a team as a code owner March 8, 2024 13:36
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GCMPushkin assumes that content field is not null. Fails when push format is event_id_only
2 participants