Skip to content

MSC4078: Transparent pusher creation #4078

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stefanceriu
Copy link
Member

@stefanceriu stefanceriu commented Nov 14, 2023

Registering pushers against push notification services should forward back failures.

Solves element-hq/element-x-ios#991 (comment)

Rendered

@stefanceriu stefanceriu changed the title Transparent pusher creation MSC4078: Transparent pusher creation Nov 14, 2023
@stefanceriu stefanceriu force-pushed the stefan/pusher-creation branch from a7883f9 to a076ee6 Compare November 14, 2023 10:36
@stefanceriu stefanceriu force-pushed the stefan/pusher-creation branch from a076ee6 to cc0dfa6 Compare November 14, 2023 10:41
@stefanceriu stefanceriu marked this pull request as ready for review November 14, 2023 10:42

## Proposal

The most straight forward solution would be to directly expose the underlying errors on POST `/pushers`. We cannot know beforehand what the final service used is so we shouldn't attempt to wrap errors and just rely on HTTP semantics.
Copy link
Member

@clokep clokep Nov 14, 2023

Choose a reason for hiding this comment

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

I think I'm not quite following what's happening; is it the following:

  1. The client configures a pusher.
  2. The homeserver happily uses that pusher for a bit.
  3. For some reason, the push service starts erroring.
    1. The error gets receive by the push gateway which passes it on.
    2. The homeserver receives the error and deletes the pusher.
  4. The user receives no more pushes.
  5. On next app launch (?) we go back to 1.

Is that accurate or is something else happening?

I'm unsure why POST /pushers/set is the proper place to return an error? How would the homeserver even track that?

Copy link
Member Author

Choose a reason for hiding this comment

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

On next app launch (?) we go back to 1.

yes, but this time round the the token will be reported as invalid by the APNs and the error will be forwarded back from synapse to the client. The client can then requests a new token from Apple and start again from 1.

I'm unsure why POST /pushers/set is the proper place to return an error? How would the homeserver even track that?

talked about this offline: we believe the best solution is to check that the pusher config is actually valid as soon the creation request comes in as opposed to deferring it until trying to send the first push and then failing silently.

@stefanceriu stefanceriu force-pushed the stefan/pusher-creation branch from 0211bf8 to 2d3d06a Compare November 14, 2023 13:32

## Proposal

The most straight forward solution would be to directly expose the underlying errors on POST `/pushers`. We cannot know
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if the actual error of the backend is actually useful for the client. Not only is it not helpful for the enduser if it seems them but also for the app it might be a variety of used backends so error handling probably ends up being a catch all regardless. I think a generic "error happened" is enough here unless I miss some usecase here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure either to be honest. For APNs for example there's quite a big difference between a recoverable 410 and a completely unrecoverable 403, we wouldn't want the app to keep trying over and over again for no reason..

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess replicating the temp fail vs permanent fail could make sense yeah. That allows for a banner like "notification is currently unavailable" or a automatic preregister attempt.

Copy link
Member

Choose a reason for hiding this comment

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

There's also quite a few layers to pass the error back through, e.g. push server -> push gateway -> homeserver -> client. This will need care to not mangle it.

@stefanceriu stefanceriu force-pushed the stefan/pusher-creation branch from 2d3d06a to 6b9153c Compare November 14, 2023 13:52
@turt2live turt2live added push proposal A matrix spec change proposal client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Nov 14, 2023
@turt2live
Copy link
Member

The SCT has been asked to review this before implementation begins, as implementation is non-trivial. Thoughts welcome.

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

the idea overall seems sensible to me, though I think we should be producing standardized Matrix errors

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

looks good to me for implementation purposes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal push
Projects
Status: Done for now
Development

Successfully merging this pull request may close these issues.

4 participants