android icon indicating copy to clipboard operation
android copied to clipboard

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

Open tobiasKaminsky opened this issue 7 years ago • 56 comments

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.

tobiasKaminsky avatar Jan 15 '18 12:01 tobiasKaminsky

Haven't I fixed this already? xD

mario avatar Oct 12 '18 09:10 mario

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 avatar Oct 12 '18 10:10 tobiasKaminsky

Working.

tobiasKaminsky avatar Oct 14 '20 10:10 tobiasKaminsky

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

skjnldsv avatar Nov 02 '20 08:11 skjnldsv

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 avatar Nov 02 '20 13:11 tobiasKaminsky

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

tobiasKaminsky avatar Nov 04 '20 09:11 tobiasKaminsky

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.

ghost avatar Nov 20 '20 18:11 ghost

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.

scroom avatar Nov 20 '20 19:11 scroom

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?

tobiasKaminsky avatar Nov 25 '20 09:11 tobiasKaminsky

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 avatar Nov 25 '20 19:11 ghost

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.

ghost avatar Nov 26 '20 19:11 ghost

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

tobiasKaminsky avatar Nov 27 '20 08:11 tobiasKaminsky

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 avatar Nov 27 '20 23:11 ghost

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.

ghost avatar Nov 28 '20 17:11 ghost

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.

nickvergessen avatar Nov 30 '20 08:11 nickvergessen

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 avatar Nov 30 '20 08:11 tobiasKaminsky

The subject is the default subject we set.

This is also encrypted, or?

tobiasKaminsky avatar Nov 30 '20 08:11 tobiasKaminsky

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

nickvergessen avatar Nov 30 '20 10:11 nickvergessen

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 avatar Nov 30 '20 13:11 tobiasKaminsky

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

tobiasKaminsky avatar Dec 04 '20 07:12 tobiasKaminsky

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.

tobiasKaminsky avatar Dec 04 '20 12:12 tobiasKaminsky

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 avatar Dec 04 '20 16:12 ghost

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?

ghost avatar Dec 05 '20 17:12 ghost

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.

nickvergessen avatar Dec 05 '20 18:12 nickvergessen

Excellent. Thanks to you both for the prompt response.

ghost avatar Dec 05 '20 19:12 ghost

The NEW_NOTIFICATONS are still sent on 3.14.3

apg1980 avatar Jan 20 '21 13:01 apg1980

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

JonasDoesThings avatar Jan 23 '21 22:01 JonasDoesThings

This is fixed with the upcoming 3.15.0

AndyScherzinger avatar Jan 25 '21 13:01 AndyScherzinger

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

XueSheng-GIT avatar Feb 04 '21 14:02 XueSheng-GIT

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

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

leptians avatar Feb 06 '21 07:02 leptians