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

Pass format, url as data and http as a kind to /pushers/set #1132

Conversation

PiotrKozimor
Copy link
Contributor

@PiotrKozimor PiotrKozimor commented Sep 8, 2021

According to documentation (https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-pushers-set) kind field can be http, email or null (although it's not defined as an enum). Also homeserver should not respect testcustom because PusherData is defined with another fields.

Signed-off-by: Piotr Kozimor [email protected]

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@reivilibre reivilibre requested a review from a team September 13, 2021 11:12
Copy link
Member

@clokep clokep left a 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");
Copy link
Member

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:

  1. Keep the custom field.
  2. Ensure the custom field, format are both passed through.
  3. Ensure the url is not passed through.

Copy link
Member

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.

Copy link
Member

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.

@clokep clokep requested a review from a team September 16, 2021 18:03
@@ -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");
Copy link
Member

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.

@richvdh
Copy link
Member

richvdh commented Sep 21, 2021

@richvdh richvdh added the X-Awaiting-Changes A contributed PR which needs changes and re-review before it can be merged label Sep 21, 2021
@PiotrKozimor
Copy link
Contributor Author

@richvdh I have signed off this PR.

@richvdh
Copy link
Member

richvdh commented Sep 21, 2021

thank you!

@PiotrKozimor PiotrKozimor deleted the piotr-kozimor/dendrite-push-notifications branch December 3, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
X-Awaiting-Changes A contributed PR which needs changes and re-review before it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants