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

Push: show real text instead of generic "new notification" #1964

Closed
tobiasKaminsky opened this issue Jan 15, 2018 · 107 comments · Fixed by #7619, #7714 or #12672
Closed

Push: show real text instead of generic "new notification" #1964

tobiasKaminsky opened this issue Jan 15, 2018 · 107 comments · Fixed by #7619, #7714 or #12672
Labels
approved bug feature: activity and notification Server activity and notifications hotspot: push notifications Push notification distribution (and, in theory, pull) pr exists

Comments

@tobiasKaminsky
Copy link
Member

User want to see the real content of notification.
As I understand this was due to a server bug, but can now be fixed for next version.

@mario
Copy link
Contributor

mario commented Oct 12, 2018

Haven't I fixed this already? xD

@tobiasKaminsky
Copy link
Member Author

It shows the push subject, but not the content.
Would it also be possible to show the complete content (as many text as fits into the notification?)

@tobiasKaminsky
Copy link
Member Author

Working.

@skjnldsv
Copy link
Member

skjnldsv commented Nov 2, 2020

Is this released? I get this since the last update.
Screenshot_20201102-083829

@tobiasKaminsky
Copy link
Member Author

Yes, since ages.
If you get this, it means that for some reason the content cannot be decrypted.
Can you check if there are wrong app tokens in web->settings?

@tobiasKaminsky tobiasKaminsky reopened this Nov 2, 2020
@tobiasKaminsky tobiasKaminsky added bug needs info Waiting for info from user(s). Issues with this label will auto-stale. and removed approved enhancement labels Nov 2, 2020
@tobiasKaminsky
Copy link
Member Author

After debugging with @skjnldsv it turns out that those strange notifications only happens when the app is not in foreground.

@ghost
Copy link

ghost commented Nov 20, 2020

I'm having this problem, too. Running client version 3.14.0 against server 19.0.5. I think it started after the upgrade from 19.0.4.

@scroom
Copy link

scroom commented Nov 20, 2020

I'm having this problem, too. Running client version 3.14.0 against server 19.0.5. I think it started after the upgrade from 19.0.4.

Same here.

@tobiasKaminsky
Copy link
Member Author

As far as I remember new_notification is the default value of push proxy, if no message is set.
@nickvergessen do you have an idea why such messages might be sent?

@ghost
Copy link

ghost commented Nov 25, 2020 via email

@ghost
Copy link

ghost commented Nov 26, 2020

I had one of these shown as having occurred 4 hours ago. When I log into NextCloud with a web browser, I see a perfectly normal notification from PhoneTrack (with correct notification text) also shown as having occurred about 4 hours ago. I have no other notifications from around that time or since in either environment. This suggests that the notification within the Nextcloud server is handled normally, but is getting lost when picked up or presented by the Android client.

@tobiasKaminsky
Copy link
Member Author

Have you removed account in question on Android or reset app token or something like that?

@ghost
Copy link

ghost commented Nov 27, 2020 via email

@ghost
Copy link

ghost commented Nov 28, 2020

The problem still occurs. The NC web interface shows a proper notification (again all PhoneTrack in my case telling me I've reached my point quota, but I think that's just because I don't get many other notifications), but "NEW_NOTIFICATION NEW_NOTIFICATION" in the Android notification bar.

@nickvergessen
Copy link
Member

do you have an idea why such messages might be sent?

Just to answer this publicly here as well. The subject is the default subject we set. The encrypted subject should be decrypted and displayed instead by the client. However in this case it seems it either fails to decrypt or to load more information from the server.

@tobiasKaminsky
Copy link
Member Author

However in this case it seems it either fails to decrypt or to load more information from the server.

At least on Android side we only show a notification if we can decrypt it and if we can get real info from server:

val result = GetNotificationRemoteOperation(decryptedPushMessage.nid)
.execute(client)
if (result.isSuccess) {
val notification = result.notificationData[0]
sendNotification(notification, account)
}

I have no real idea how this could happen…

@mrclschstr
Copy link

Ok. I have had this same problem some time ago with talk notifications, and for testing I have done the same procedure with the Nextcloud app. It has worked. Notifications reappear successfully. The problem lies in the Nextcloud database, specifically in the table _notifications_pushhash which it is structured as follows: Id uid Token deviceidentifier devicepublickey devicepublickeyhash Pushtokenhash ProxyServer apptype The fact is that what we need for the notifications to work again we must delete the entries that have the account to which the notifications do not work, for this we connect via console to the mysql server. mysql -u root We select the nextcloud database. Use NextCloud; Let's first see if there are entries for a certain user. Replace mike with your user. SELECT * FROM oc_notifications_pushhash WHERE uid='mike'; In case you return a record we will delete it. DELETE FROM oc_notifications_pushhash WHERE uid='mike'; Delete accounts from the android app and log back in. For me this has worked.

Try now notifications with sudo -u www-data php occ notification:test-push

Cheers.

This worked for me as well, thank you very much!

@ghost
Copy link

ghost commented Jun 18, 2023

Unfortunately, this is not a nice solution and does not prevent the problem. Please, dear Nextcloud team, take care of this bug.

@jficz
Copy link

jficz commented Jun 19, 2023

Delete accounts from the android app and log back in. For me this has worked.

This is where things become complicated, because of #11090

@Zocker1999NET
Copy link

Zocker1999NET commented Jun 20, 2023

If reregistering the app is a workaround to fix this issue, would it be a somewhat solution to allow reregistering for notifications without logging out and maybe then also do that automatically when the app receives a broken message?

This may make the experience good enough for end users while the server may log all of this circumstances so it is possible for admins / devs to debug this issue.

And I know, that temporary solution might stay forever, but in perspective of how long this bug exists so far, this may be good enough in practice ;)

@ghost ghost mentioned this issue Jun 26, 2023
4 tasks
@ghost
Copy link

ghost commented Jun 26, 2023

I don't know if the following is known to the Nextcloud team, therefore a small description:

Steps to reproduce;

  1. get a message or create one using administrator tools
  2. see on your Android app that the generic "new notification" appears as notification
  3. delete the notifications in the browser
  4. see how for each deleted message your phone gets spammed with more generic "new notification" notifications

No matter if the message is already deleted in the app or not each time it will generate enormous amount of spam. I don't know how this is handled now with the messages (Firebase, or own infrastructure) But the way I see it is an unnecessary load on the system.

@mercury1337
Copy link

None of the workarounds or fixes provided here helped so far.

However I received one (!!!) notification properly last week - I don't know what happened as I didn't change anything on my Nextcloud installation but suddenly one notification was displayed properly on my mobile. After that everything is back now to the "new notification" thing. 😢

@koying
Copy link
Contributor

koying commented Jul 21, 2023

@jtorqui74

Ok. I have had this same problem some time ago with talk notifications, and for testing I have done the same procedure with the Nextcloud app. It has worked. Notifications reappear successfully. The problem lies in the Nextcloud database, specifically in the table _notifications_pushhash

Tricky fix, but worked for me, this has been bothering me for quite a while now.
Thanks much for finding out !! 😍

@HammyHavoc
Copy link
Contributor

Seeing this problem too.

@nursoda
Copy link

nursoda commented Aug 15, 2023

DELETE FROM oc_notifications_pushhash WHERE uid='nursoda';
Delete accounts from the android app and log back in.

Thanks! Since it helped some guys here, I tried that. Without success:

I deleted the rows in the DB and the corresponding account in the app (I use several accounts in the app). I then force-closed the app, re-started it and re-created the just deleted account. Result: Account is available again and does receive test notifications in-app. Yet, no Android notifications. The app does not re-register with the cloud:

nc-user@server /path/cloud $ occ notification:test-push nursoda
No devices found for user

This correlates with not an entry in the DB:

MariaDB [cloud]> SELECT * FROM oc_notifications_pushhash WHERE uid='nursoda';`
Empty set (0,000 sec)

Server: 27.0.1, App 3.25.0, Phone: Pixel 6a running GrapheneOS with their sandboxed Play Service. All other apps work fine including push, e.g. Signal, Threema, Bank apps.

What now? Do I need to wipe all data from the NC app? Might this be a Graphene Play Services bug? How to debug and find out which app or service to blame? What about missing library / invalid notification channels mentioned above? Where are those logs referenced there?

@lfom
Copy link

lfom commented Aug 16, 2023

@nursoda It seems that NextCloud app does not request another token unless it is removed and installed again. At least for me it was the only way to get a new token using MicroG after removing the older (broken) token from the server database. It's a pain, but since then notifications have been working fine.

@nursoda
Copy link

nursoda commented Aug 16, 2023

Thanks for that hint. I deleted all data from the app (instead of deleting and re-installing it), and it worked. Quite painful if you use multiple NC instances like me.

@mercury1337
Copy link

Tried again on fresh installation - still not working:

Trying to push to 1 devices

Language is set to en_GB
Private user key size: 1704
Public user key size: 451
Identified 0 Talk devices and 1 others.

Device token:67636
Device token is valid
Device public key size: 451
Data to encrypt is: {"nid":3437,"app":"admin_notifications","subject":"Testing push notifications","type":"admin_notifications","id":"64fd8129"}
Signed encrypted push subject
Deleting device because it is unknown by the push server: 12JrPiB9KvMQbE83xs2Q3dWURmblKztjKdP3o/DEcOyROzp8iIhFqFkj6B5g9QaFW+3+2SnBzIjlIdavTbegA==
Push notification sent, but 1 failed

@pabloeisenhut
Copy link

If the Nextcloud app is open in the foreground and a notification arrives during that time, the notifications will be displayed correctly.

@EnderArchery
Copy link

EnderArchery commented Sep 12, 2023 via email

@mercury1337
Copy link

I can confirm that the notification is shown properly when the app is in foreground. When it is in background I only get the generic text "NEW NOTIFICATION"

@joshtrichards joshtrichards added the feature: activity and notification Server activity and notifications label Oct 8, 2023
@HammyHavoc
Copy link
Contributor

Is anybody currently investigating this and getting anywhere? If not, I might give this a poke this weekend and see where I get with it.

@PeggyFree
Copy link

PeggyFree commented Nov 29, 2023

I subscribe here since I never got a readable notification on my phone and I won't re-install it as I don't want to lose my settings

@sander85
Copy link

sander85 commented Dec 2, 2023

Would be nice to have an entry in the app settings like "Fix notifications" or something like that, that will trigger new registration with the server. There are other apps that can do it. My setup is quite complex on my phone, and wiping it all just doesn't make sense.

@joshtrichards joshtrichards added the hotspot: push notifications Push notification distribution (and, in theory, pull) label Dec 8, 2023
@qguv
Copy link

qguv commented Mar 10, 2024

I've been dealing with this for quite some time. Is there any plan to pick this up?

@kakuy
Copy link

kakuy commented Mar 11, 2024

I switched to this notifications app for Nextcloud and it works really well.

https://gitlab.com/Nextcloud-Push

It's a bit old and it does have some scalability shortcomings (they can be worked around but it needs some understanding of the webserver/php config)
I works perfectly for all notifications from the server (2FA, Talk, Calendar, etc.)... And the best part is that it does not depend on google services, so it works even on ungoogled devices.

@pabloeisenhut
Copy link

So the workaround is a great thing, but it's not a permanent solution, especially for users without technical knowledge.

@jficz
Copy link

jficz commented Mar 11, 2024

I wouldn't call Nextcloud-push a "workaround", it is a rather specific solution for notifications which has very good use cases but I agree that it is not the solution to this problem.

@kakuy
Copy link

kakuy commented Mar 11, 2024

I know it is not a workaround, but it does solve most evident symptoms in this thread (show correct notifications on a phone).

I don't pretend to minimize the problematic behind reliable push notifications nor the complexities and priorities of the project but... I just don't understand why issues related to notifications take so much time to be addressed when there are alternatives that work and just need a little polish.

This ticket was opened more than 5 years ago, fixed and refixed and it keeps coming back. By the looks of the fixes it seems it's just a matter of following google's firebase dependency. There are other tickets asking for an official alternative to google handled notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved bug feature: activity and notification Server activity and notifications hotspot: push notifications Push notification distribution (and, in theory, pull) pr exists
Projects
None yet