nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.15k stars 1.75k forks source link

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

Open tobiasKaminsky opened 6 years ago

tobiasKaminsky commented 6 years ago

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 commented 5 years ago

Haven't I fixed this already? xD

tobiasKaminsky commented 5 years ago

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 commented 3 years ago

Working.

skjnldsv commented 3 years ago

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

tobiasKaminsky commented 3 years ago

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 commented 3 years ago

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

ghost commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

I thought it was occurring when NC apps had updates available, but I got one of these this morning and I don't have any apps needing updates.

I'm not familiar with the language NC is written in, but it may have something similar to the Perl "caller" routine, which allows a routine to determine who called it. If you have such a thing, you might consider changing the default value to include the caller name or other identifier. That would make future occurrences easier to debug.

If I learn anything about the source, I'll update the ticket.

            -Brian M

On 11/25/20 1:41 AM, Tobias Kaminsky wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/1964#issuecomment-733591143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOA77LKIUFVD3UWG66TFTSRTGLBANCNFSM4ELZH6DA.

ghost commented 3 years ago

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 commented 3 years ago

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

ghost commented 3 years ago

I had not made any change there.  I know that the Nextcloud client still allowed me to access my files, make changes, etc. That suggests that the account credentials were operating normally, at least in some regards.

Nevertheless, I have now deleted the Android client account from the client, and then and re-added it using an app token.  I'll advise you as to whether the problem goes away or continues.

On 11/27/20 12:44 AM, Tobias Kaminsky wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/1964#issuecomment-734717427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOA7Y2LLQTWM5R2UMZRZLSR5RFVANCNFSM4ELZH6DA.

ghost commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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: https://github.com/nextcloud/android/blob/f0f467d2a10ffe0dc36663a2e81beb9ac96d578f/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt#L245-L250

I have no real idea how this could happen…

tobiasKaminsky commented 3 years ago

The subject is the default subject we set.

This is also encrypted, or?

nickvergessen commented 3 years ago

This is what we do:

    p := fcm.Notification{
        Title:       "NEW_NOTIFICATION",
        TitleLocKey: "NEW_NOTIFICATION_TITLE",
        Body:        "NEW_NOTIFICATION",      // Required for iOS
        BodyLocKey:  "NEW_NOTIFICATION_BODY", // Required for iOS
        Sound:       "default",
    }
    d := map[string]string{
        "subject":   n.Subject,
        "signature": n.Signature,
    }

    return fcm.Message{
        Notification:     p,
        Data:             d,
        To:               n.pushToken,
        ContentAvailable: true,
        MutableContent:   true,
        Priority:         priority,
    }

So data contains the original encrypted subject, and the title + body are unencrypted, untranslated, generic placeholders

tobiasKaminsky commented 3 years ago

This is what I suspect: if for $strange reason, push proxy sends a notification to Android device with an old token, the Android device tries to match the token, but fails, then Android (!) still shows the notification, not our app.

I discussed this with @skjnldsv who even had removed any c.nc.c account, but still received a NEW_NOTIFICATION message, but in logcat none NotificationWork related info was shown.

tobiasKaminsky commented 3 years ago

I removed my last message, as it was a wrong assumption and thus the test would not have helped.

tobiasKaminsky commented 3 years ago

So we changed something in the way push messages are transferred to google cloud messaging. @MartinConsultingServicesInc can you try it again? Just create one push.

ghost commented 3 years ago

Notifications happen spontaneously. I don't know how to manually trigger one. I should have a spontaneous one later today, but if you want to tell me of a trick to force one, I'm happy to do it. Otherwise, I'll let you know how the next one goes.

ghost commented 3 years ago

That fixed it. Since late yesterday my notifications are coming in with the correct text.

I don't see that my Android Nextcloud client software has been updated in the last several days, and I haven't updated my server software. How am I seeing this change, then?

nickvergessen commented 3 years ago

The Android app is registering with incorrect data/user agent on some android versions. The push proxy database had a lot of entries with type "unknown". After checking the patterns of the push tokens it seemed like those should all be from the android app and we manually reset the typo for them. It will be fixed in the next android app update. Until then we will observe and manually fix the type from time to time for newly registered devices.

ghost commented 3 years ago

Excellent. Thanks to you both for the prompt response.

apg1980 commented 3 years ago

The NEW_NOTIFICATONS are still sent on 3.14.3

JonasDoesThings commented 3 years ago

Can confirm that this issue still persists.

App version: 3.14.3 Nextcloud Version: 20.0.5 Phone: Oneplus 8T Android Version: Oxygen OS 11.0.6.8.KB05AA

AndyScherzinger commented 3 years ago

This is fixed with the upcoming 3.15.0

XueSheng-GIT commented 3 years ago

I've updated to 3.15 and still get NEW_NOTIFICATION instead of a proper notification text!

leptians commented 3 years ago

I'm also getting the same message and I'm behind NGINX

Android App: 3.15 Nextcloud: 20.0.7 Phone: Pixel 2 XL

palight commented 3 years ago

Hello,

I just tested after reseting my app (data and cache) and revoking the autorisations for my device. When I register the device again, problem is still there.

It was working fine before my update to android 11 (and the reset of my device

I'm on 20.0.8 for server and 3.15 for android app

major-mayer commented 3 years ago

This issue shouldn't be closed! I am on Nextcloud 3.16.1 / Android 11 and use Nextcloud 21 on the server side and still get this notification very often in the last weeks. Here is a screenshot: Screenshot_20210614-114030

scrampker commented 3 years ago

I have this as well, and I wonder if there's any connection to using MicroG on a de-googled device?

roboticsalign commented 3 years ago

This issue shouldn't be closed! I am on Nextcloud 3.16.1 / Android 11 and use Nextcloud 21 on the server side and still get this notification very often in the last weeks. Here is a screenshot: Screenshot_20210614-114030

Same problem here with Samsung S10 and German UI.

Pilzinsel64 commented 3 years ago

For me the same. It happens since a few days without an update of the app. It worked for nearly two years without problems. That's a mistary xD

So, maybe it's a temporary thing? If yes, that would mean that it's not reproduceable for the developers. Any ideas how I could provide requied infos in this case?

Nextcloud 22.0.0 with latest Client Push app configured and Android app Version 3.16.1.

If I have time and a more empty brain the next days I would try re-installing the app, maybe that helps (would notify you when I did). Because simply clear the app data isn't possible. The Nextcloud app provides its own data removeal function in the Android App Settings.

major-mayer commented 3 years ago

That's actually a good hint, I also configured the client push app roughly the same time when this issue occurred. Maybe it has something to do with the push notifications sent from the client push service (the Rust based one/ "Files High Performance Backend"). IIRC this new push notifications do not contain any information but just say "Hey something changed here", at least that's what you see when you inspect the WebSockets connection in the browser.

Edit: Well no this is most likely not the issue. I just confirmed that the 2 NEW_NOTIFICATION notification that I received come from the Nextcloud calender, which is not using the notify push backend. Also the WebSockets connection should not be used for mobile clients.

Pilzinsel64 commented 3 years ago

Maybe as additional information about my android device:

Samsung Galaxy S10 -> fingerprinted and simulated as Google Pixel 4 with MagiskHideProps to get banking push tan app and Galaxy Wearable app working; and working SafetyNet check LineageOS 18.1 (Android 11) -> with Google Play Services & Store installed

If you now think that my constallation of my installed system would have to do something with the problem ... I have this constallation about two years now. The Nextcloud app wokred great. The problem appeared one week before now.

tchernobog commented 3 years ago

For me, uninstalling the app and installing it again was a workable workaround.

chadblose commented 3 years ago

I'm also receiving these notifications on my Google Pixel 5. Uninstalled the app and reinstalled. Just got a new "NEW_NOTIFICATION" message. I checked my recent notifications inside the app and it was trying to tell me there was an update available for Contacts to version 4.0.1

tehCrush commented 3 years ago

I'm also receiving these notifications on my Google Pixel 5. Uninstalled the app and reinstalled. Just got a new "NEW_NOTIFICATION" message. I checked my recent notifications inside the app and it was trying to tell me there was an update available for Contacts to version 4.0.1

can confirm, pixel 5 as well. Uninstalling Nextcloud, restarting the phone and reinstalling it fixed it for me. First occurence was the switch from my old Galaxy S7 to my current Pixel 5. I would guess it had to do something with the data transfer from old to new.

kagbasi-aerwireless commented 2 years ago

Adding my two cents to this topic as well. I, too, am experiencing this problem on my Samsung Galaxy S10. Nextcloud App version 3.17.0.

Here's a screenshot: Screenshot_20211003-110612_One UI Home

obbardc commented 2 years ago

happening again on pixel 6 pro, seems to be daily or so for me at about 22:30

jakobroehrl commented 2 years ago

Same problem since 3.18. see: https://github.com/nextcloud/android/issues/9352

jakobroehrl commented 2 years ago

Same problem since 3.18. see: #9352

solved for me with reinstalling the app

EnderArchery commented 2 years ago

I have reinstalled it, but I just had another one of them. Nextcloud-App on Android 11 (OnePlus 8 Pro) version 3.19.1 RC2 Nextcloud version 23.0.2. Nothing found in the servers log.

In this specific case it was a notification about an update of Breeze Dark.

Pkshields commented 2 years ago

This issue has just occurred for me as well on a days old installation of Nextcloud and the Android app.

Nextcloud Android app version 3.19.1, installed through the Play Store. Pixel 5, running Android 12 Nextcloud version 23.0.3

The notification in my case was for updating Nextcloud to 23.0.4. Reinstalling the app didn't fix the issue for me.

ariselseng commented 2 years ago

Happens to me as well. Reinstalling the app does not help. I am using the client push on the server like some other reports here. Maybe it is related?

Zocker1999NET commented 2 years ago

Happens to some users of my instance as well. I haven't configured client push. App installed using Google Play Store, Nextcloud Server 23.0.5.

Webbeh commented 2 years ago

Same issue. Appeared a few weeks ago, couldn't tell when exactly.

Started appearing with server v23.x.x and still occurs now with server 24.0.1.

Have not installed the "client push" service.

ghost commented 2 years ago

Still an issue in Nextcloud 24.0.2