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

Missing app updates #226

Closed
Simounet opened this issue Nov 26, 2018 · 20 comments
Closed

Missing app updates #226

Simounet opened this issue Nov 26, 2018 · 20 comments

Comments

@Simounet
Copy link
Member

Steps to reproduce

  1. Wait for an app update

Expected behaviour

Should see a notification about the app update.

Actual behaviour

Nothing shows up even if I have few rows on the oc_notifications table:
app: updatenotification
subject: update_available

Thanks for this amazing piece of software anyway!

@nickvergessen
Copy link
Member

Works fine here. Can you post the full database entry?

@Simounet
Copy link
Member Author

Simounet commented Dec 4, 2018

notification_id: 48
               app: updatenotification
              user: Simounet
         timestamp: 1542909615
       object_type: core
         object_id: 14.0.4.2
           subject: update_available
subject_parameters: {"version":"Nextcloud 14.0.4"}
           message:
message_parameters: []
              link:
           actions: []
              icon:

@paulchen
Copy link

paulchen commented Dec 4, 2018

Some time ago, I wrote a simple Python script that polls the Notification API for the admin user. I use this script as an Icinga plugin to be ensure that my Nextcloud installation is always up-to-date.

Recently, I noticed that I get a notification in the web interface, but not via the API. The notification in the database looks similar to the one @Simounet posted. I think that this problem is at least related to the one this issue is about.

I dug a bit into this problem:

To verify this, I temporarily set the parsedSubject in Handler#notificationFromRow. As a result, the API then returns the notification as it is found in the database.

@nickvergessen nickvergessen transferred this issue from nextcloud/notifications Dec 17, 2018
@nickvergessen nickvergessen transferred this issue from nextcloud/server Dec 17, 2018
@nickvergessen
Copy link
Member

Are you sure the updatenotification app is enabled?
That should set the parsedSubject when the Manager#prepare is called, and then it shows up correctly for me.

@tobiasKaminsky
Copy link
Member

tobiasKaminsky commented Jan 7, 2019

Are you sure the updatenotification app is enabled?

Yes, for me it is installed, but I do not get a push notification that a new update (app / server) is available.
However I do see the bell with a red dot (notification) once I login via admin/an user which is in the update notification group I specified.

@Simounet
Copy link
Member Author

My bad, I installed NC a long time ago (through OC) and I didn't have the updatechecker parameter set to true into my config.php file. Now it is working as expected. Thanks for your help!

@tobiasKaminsky
Copy link
Member

For me this is not yet solved:

  • I do see a notification on web ui
  • I do not get a push notification

@paulchen
Copy link

I still observe this problem as well:

@nickvergessen
Copy link
Member

@paulchen which version of nextcloud and the notifications app are you using exactly?

@paulchen
Copy link

@paulchen which version of nextcloud and the notifications app are you using exactly?

Nextcloud 15.0.0 and Update Notifications 1.5.0.

@elmarfu
Copy link

elmarfu commented Mar 7, 2019

Hi at all,
I'm also experiencing this issue. Right at the moment Nextcloud 15.0.4 and Update Notifications 1.5.0 are installed on my production environment.
The oc_notifications table contains similar data like mentioned above and I get the white bell with a red dot via GUI (actual the notification for Nextcloud 15.0.5), but I don't receive a notification through the (Windows 10) desktop client v2.5.1.
First I thought this is an issue with the desktop client and started to downgrade from version 2.5.1 over v2.5.0 (no notification) to v2.3.3.1 (this works!). Hopefully this information is useful for further debugging. After that I switched back to version 2.5.1, because the new features outweigh the notification function. ;-)
Then I stumbled upon this thread and tried for example the updatechecker parameter set to true in my config.php file like @Simounet wrote, but this didn't help for me -> still no notification via desktop client v2.5.1.
Unfortunately I'm rather ops than dev and have just little knowledge in PHP, so I'm not able to apply the workaround described by @paulchen (adding a call to setParsedSubject in Handler#notificationFromRow). Maybe someone can explain this workaround in more detail for a dummy like me? :-)
Please let me know if I can further help or assist!

@paulchen
Copy link

@elmarfu I created a patch from the changes I applied to my Nextcloud instance:

--- cloud-old/apps/notifications/lib/Handler.php        2019-03-17 22:09:44.476893338 +0100
+++ cloud/apps/notifications/lib/Handler.php    2019-03-17 22:08:45.892292939 +0100
@@ -273,7 +273,8 @@ class Handler {
                        ->setUser($row['user'])
                        ->setDateTime($dateTime)
                        ->setObject($row['object_type'], $row['object_id'])
-                       ->setSubject($row['subject'], (array) json_decode($row['subject_parameters'], true));
+                       ->setSubject($row['subject'], (array) json_decode($row['subject_parameters'], true))
+                       ->setParsedSubject($row['subject']);
 
                if ($row['message'] !== '') {
                        $notification->setMessage($row['message'], (array) json_decode($row['message_parameters'], true));

Save it to a file and apply it with patch -p1 at the root directory of your Nextcloud installation. You can try patch -p1 --dry-run first to verify that the patch can be applied. You can also change the code manually if you want.

Please keep in mind that I'm not responsible if anything goes wrong with your installation.

At the moment, I'm using Nextcloud 15.0.5 together with Notifications 2.3.0.

@ghost
Copy link

ghost commented Mar 17, 2019

Can this be solved with the patch from @paulchen ? I fear that I might get hacked because I don't get informed by nextcloud via mail when an important update is available.

@nickvergessen
Copy link
Member

No, that is not a valid solution/workaround.
If that works for you, please send me a copy of your oc_notifications database row to <my github name>@nextcloud.com

@elmarfu
Copy link

elmarfu commented Mar 22, 2019

I tried the patch from @paulchen, but it didn't change anything. So I reverted it.
@nickvergessen and for the journal: here's my row from oc_notifications:
notification_id: 17 app: updatenotification user: sxxxxn.hxxxxxxl timestamp: 1551390300 object_type: core object_id: 15.0.5.3 subject: update_available subject_parameters: {"version":"Nextcloud 15.0.5"} message: message_parameters: [] link: actions: [] icon:
Summary: still no update notification via (Windows 10) desktop client v2.5.1, but GUI shows it.
Question: can I provide further information for discovering the issue?

@nickvergessen
Copy link
Member

Push notifications for updatenotifications have been fixed with nextcloud/server#14744

@elmarfu
Copy link

elmarfu commented Mar 27, 2019

@nickvergessen: unfortunately the patch provided here nextcloud/server#14744 respectively [stable15] Always register the Notifier #14749 doesn't seem to fix my problem...
Question 1: should the patch really solve my problem with missing update notifications via (Windows 10) desktop client v2.5.1 or am I on a wrong track?
Question 2: I'm still at Nextcloud 15.0.4. Should the patch also work with 15.0.4 or is 15.0.5 required?
Thanks a lot and best regards!

@tobiasKaminsky
Copy link
Member

@nickvergessen as you know it worked very well with your fix on NC15.
After upgrading to NC16 I do not get any notification about a new update: neither in web ui (no red alarm bell), nor as push.

@nickvergessen
Copy link
Member

16 is something completely different and should have it's issue in the server component.

@paulchen
Copy link

paulchen commented Apr 5, 2019

Today I got the notification about the availability of Nextcloud 15.0.6. Using this notification, I was able to verify that the changes from nextcloud/server#14744 indeed fixed my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants