-
Notifications
You must be signed in to change notification settings - Fork 58
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
Pass format, url as data and http as a kind to /pushers/set #1132
Pass format, url as data and http as a kind to /pushers/set #1132
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.
Looks like it is on the right track, but I don't think it is handling custom data correctly.
@@ -50,7 +52,8 @@ | |||
assert_eq( $pusher->{device_display_name}, $device_display_name, "device_display_name"); | |||
assert_eq( $pusher->{pushkey}, $pushkey, "pushkey"); | |||
assert_eq( $pusher->{lang}, $lang, "lang"); | |||
assert_eq( $pusher->{data}{testcustom}, $customdata, "custom data"); |
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.
I think we still want to ensure that custom fields are passed through.
Looking at the push gateway spec, data
that is sent to the push gateway should be:
A dictionary of additional pusher-specific data. For 'http' pushers, this is the data dictionary passed in at pusher creation minus the
url
key.
I think the changes should be:
- Keep the custom field.
- Ensure the custom field,
format
are both passed through. - Ensure the
url
is not passed through.
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.
I think this looks OK, but I'm unsure if url
should be there or not, going to see what others think.
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 is checking the response from GET /r0/pushers
, rather than the data sent to the push gateway. This looks correct to me.
@@ -50,7 +52,8 @@ | |||
assert_eq( $pusher->{device_display_name}, $device_display_name, "device_display_name"); | |||
assert_eq( $pusher->{pushkey}, $pushkey, "pushkey"); | |||
assert_eq( $pusher->{lang}, $lang, "lang"); | |||
assert_eq( $pusher->{data}{testcustom}, $customdata, "custom data"); |
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 is checking the response from GET /r0/pushers
, rather than the data sent to the push gateway. This looks correct to me.
@PiotrKozimor please can you sign off your contribution, per https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off ? |
@richvdh I have signed off this PR. |
thank you! |
According to documentation (https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-pushers-set)
kind
field can behttp
,email
ornull
(although it's not defined as an enum). Also homeserver should not respecttestcustom
becausePusherData
is defined with another fields.Signed-off-by: Piotr Kozimor [email protected]