-
Notifications
You must be signed in to change notification settings - Fork 741
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
Unifiedpush #3448
Unifiedpush #3448
Conversation
Note: embedded distrib means FCM if nothing else is installed (or if the user want this), so probably most of users Edit: Not true since 4a8fa4a |
The last commit create a different pusher app id whether it uses the embedded distrib or not. It is now possible to have a pushkin for the actual main version (GCM), this PR version using the embedded distrib (FCM), and this PR version with unifiedpush. |
The last commit allows to use the current gateway as it is (sygnal with gcmpushkin) for the FCM embedded distrib. |
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.
Thanks for the PR, it looks promising. One first question
vector/src/gplay/java/im/vector/app/push/fcm/NotificationTroubleshootTestManagerFactory.kt
Show resolved
Hide resolved
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.
- Some other comments.
- Also can you please review https://buildkite.com/matrix-dot-org/element-android/builds/2686#8c47ad6f-354f-4f9e-b0e0-e87c23230d22?
- And rebasing the PR should fix the lint issue about "radio".
vector/src/gplay/java/im/vector/app/push/fcm/NotificationTroubleshootTestManagerFactory.kt
Outdated
Show resolved
Hide resolved
vector/src/fdroid/java/im/vector/app/push/fcm/NotificationTroubleshootTestManagerFactory.kt
Outdated
Show resolved
Hide resolved
vector/src/fdroid/java/im/vector/app/push/fcm/NotificationTroubleshootTestManagerFactory.kt
Outdated
Show resolved
Hide resolved
vector/src/fdroid/java/im/vector/app/push/fcm/NotificationTroubleshootTestManagerFactory.kt
Outdated
Show resolved
Hide resolved
vector/src/gplay/java/im/vector/app/push/fcm/NotificationTroubleshootTestManagerFactory.kt
Outdated
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/core/pushers/VectorMessagingReceiver.kt
Outdated
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/settings/troubleshoot/TestNewEndpoint.kt
Outdated
Show resolved
Hide resolved
@@ -15,6 +15,8 @@ | |||
|
|||
<!-- Note: pusher_http_url should have path '/_matrix/push/v1/notify' --> | |||
<string name="pusher_http_url" translatable="false">https://matrix.org/_matrix/push/v1/notify</string> | |||
<!-- Note: pusher_http_url should have path '/_matrix/push/v1/notify' --> | |||
<string name="default_push_gateway_http_url" translatable="false">https://matrix.gateway.unifiedpush.org/_matrix/push/v1/notify</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.
Update the comment?
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.
One remark, but an important one, what happen if this service is down?
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 push gateway is used to forward notifications to users' UnifiedPush endpoints and is not used by the FCM embedded distributor. So if it is down, users using another UnifiedPush distributor than the embedded one (which will be used by most users) won't receive push notifications. Just like users using FCM embedded distributor won't receive push notif if the matrix sygnal server is down.
This push gateway is the unifiedpush common-proxies on our server. It can be hosted by element/matrix team. It is also possible to write a sygnal pushkin for that: it should be quite easy to write (with a big warning on SSRF).
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.
But if I want to use my server, without participation unifiedpush.org?
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.
@manchelsi You can self host a push proxy like gotify or nfty alongside common-proxies (only required for gotify), install the apps, point them to your server, and tell element to use the app as a distributor.
It should be fine now :) |
gplayImplementation('com.github.UnifiedPush:android-embedded_fcm_distributor:1.1.0') { | ||
exclude group: 'com.google.firebase', module: 'firebase-core' | ||
exclude group: 'com.google.firebase', module: 'firebase-analytics' | ||
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector' |
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.
It's weird that we have to exclude those modules again, since it's already done here: https://github.com/UnifiedPush/android-embedded_fcm_distributor/blob/main/lib/build.gradle#L44
Anyway, the CI is happy now, thanks
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.
Yes, that's very weird. And when the lib is a module of the project it isn't necessary. That's probably because of jitpack then
Hello @p1gp1g , Thanks for the update of the PR. Can you explain what will happen when the user will upgrade their GPlay application with a new version with this PR included? Does the app will have to register again the pusher? I'd like to ensure that this scenario is currently handled, and that the user will still receive push as normal. Thanks |
If the user doesn't have any unifiedpush distibutor (eg. gotify-up) it is transparent. I have tested the migration from main branch to this PR. The reason is every time the application is started, it does the unifiedpush registration (to the saved distributor if it exists). So it receives a new endpoint and register the pusher again (https://github.com/vector-im/element-android/pull/3448/files#diff-89945d3e11caf4a6cddd30ff052082001992c86186660ee2e1c9093f04c87f30R164). Edit: check done with dbfa5e1 |
We can mention issue #224 (in the roadmap too) : The gplay flavor works like the fdroid one if there is no play services |
I guess the user has to install a unifiedpush app like gotify-up in order to make it work for element? |
Phones will always have a way to receive notifications, with and without unifiedpush distribtutor. cf #3448 (comment) But it is possible to add a check on the troubleshoot list that say : the distributor used if any, no distributor is found if it uses the background sync. I don't know if it is useful since it is already viewable : the troubleshoot list displays the endpoint or background sync information |
Ah I see, thanks for replying. Hope this gets merged soon - don't get any notifications from Element (F-Droid, Lineage with microG). Looking at PlayStore reviews, I'm not the only one (although oddly, they should have fcm). |
In TWIM, you said that we should tell you if we didn't get a push notification last week... I didn't get one (Element Android, F-Droid).
Source: TWIM 2021-08-13 |
Now there is an merge conflict 😢 - I really wish this PR is merged soon (On F-Droid this is not an instant messaging 😭 , nearly useless for Messaging ) Thank you for the great work till yet @p1gp1g |
Yes it's frustrating. This PR has been open for a long time. There was a time when there was no merge conflicts. If you're not patient, there is the beta version of SchildiChat which is a fork of Element. It had UnfiedPush implemented in it. |
The conflict is just another addition on the build.gradle, nothing relevant 😉 |
Really SchildiChat#68 is still open and say it is an upstream issue? Or do you mean https://fluffychat.im ? |
"Upstream" issues do not prevent SchildiChat from implementing it anyways. It's still open as it's not enabled in stable/production builds yet. |
Is there a reason why we don't get events in fast lane on push notification with a sync as a fallback ? (cf 94f9f7f) Should I merge this commit here ? |
This commit is not OK to me, a sync is often necessary, to be able to decrypt encrypted messages, or to handle other messages, which was not triggering a Push. |
Indeed, I've observed that, as it is, the fallback to the sync does not always occured and that's the most important thing. Moreover, it seems it doesn't go faster most of the time. Fortunately, I didn't commit it here :) |
PR is rebased. For your information, we have released a FOSS library to receive notification via google service [1][2]. This library does not use any proprietary lib, and so it follows FDroid rules. You might want to use it and having a single flavor. If you are interested, I can do it in another PR Also, it would be great to have some information on the internal discussion state. [1] https://unifiedpush.org/developers/embedded_fcm/ |
Please correct me if I'm wrong, but I think most of the point of UnifiedPush is because it's not Google. |
Indeed, but most users and developers will continue to use Google services. With these libraries (foss & non-foss embedded distributor) users can continue to receive notifications with google services if they want to and it is pretty easy to setup for developers. With the FOSS one, it is achieved without having any proprietary code in the app, so we know there is not any telemetry thing running in the app. I'd like to avoid too much noise on this PR, if you want to, you're welcome to come in our room : https://matrix.to/#/#unifiedpush:matrix.org |
A half year without review, comment or so ... |
Signed-off-by: sim <[email protected]>
Merged in my branch, will do some rework on it and create a new PR. |
It would be really nice, when we get an issue or an Milestone, where we could trace, that is released. |
Maybe this issue #2743 |
Pull Request Checklist
This new PR for UnifiedPush (old: #2993) is rebased, have a better git flow and the previously missing parts are done.