Fixing Web Notification: MySQL, oc_notifications and link

This was noticed while Upgrading from 10.0.1->10.0.2->11.0.0:

Notification

However, when clicking on the notification icon bell with the red dot on it and then hovering over the item of notification, the INCORRECT server is shown in the tool tip display.
In fact the INCORRECT server was actually the first server used in the INITIAL setup of config.php:

‘trusted_domains’=> array (0=> ‘first_server’, 1=>others, 2=>another) which is no longer used.

Now config.php is using ‘trusted_domains’=> array (0 => ‘new_server’,).

The web notification is obtaining the (target) server (in this case first_server) from a location that is stuck with the INITIAL setup value or the value used when the notification came in. In many cases that value may no longer be valid because the server has changed.

Having read the post "Survey client notification going to wrong URL"
Survey client notification going to wrong URL

Here are further details how to fixed the problem using MySQl database:

1. Log in to MySQL

mysql -u userName -p

2. Go to nextcloud database

SHOW databases; // get name of next cloud data base for example nc_database

USE nc_database;

3. Go to oc_notification table

SHOW tables; //table of interest is oc_notifictions

SELECT * FROM oc_notifications;

4. Field of interest is link. Select a couple of fields to see what is going on

SELECT notification_id, app, link FROM oc_notification;

5. Change link field to correct value

UPDATE oc_notifications set link = “correct_server_URL” WHERE notification_id=actual_value;

//not necessary to use WHERE clause

UPDATE oc_notifications set link = “correct_server_URL”;

5. Quit MySQL

quit;

Hovering over the item of notification should display the CORRECT server in the tool tip display.

Can you create an issue on github please?

Hi @nickvergessen,

Sure I would like to. Point me to instructions on how to. Thanks!

I’ll Google how to too!

OK Got it. I’ll set up an git account and take care of it no problem.

I already took care of fixing it, since it was reported yesterday again: https://github.com/nextcloud/notifications/issues/54

Thanks! @nickvergessen. I am new with the github. Thanks to your request to report an issue, I have a github account and will contribute. Thanks!

1 Like