mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.26k stars 1.38k forks source link

Push notifications do not work (SQL syntax error) #8385

Open errotu opened 1 day ago

errotu commented 1 day ago

Summary

Push notifications do not work on Android and iOS, probably due to a SQL syntax error.

Steps to reproduce

  1. User A sends a message to user B.
  2. User B expects push notification on the other end.
  3. User B does not receive a push notification.

Operating System

CentOS7

Mattermost Server Version

10.2.0

Expected behavior

Push notifications should be sent to the mobile devices.

Observed behavior

Mobile devices do not receive push notifications (iOS and Android alike).

Log Output

Hundreds of entries like this:

{"timestamp":"2024-11-28 20:53:55.332 +01:00","level":"error","msg":"Failed to send mobile app sessions","caller":"app/notification_push.go:123","logSource":"notifications","type":"push","status":"error","reason":"fetch_error","user_id":"3875fqztif8exe4oo8c1enwd8o","error":"getMobileAppSessions: We encountered an error while finding user sessions., failed to find Sessions with userId=3875fqztif8exe4oo8c1enwd8o: Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>>'$.last_removed_device_id', '')' at line 9"}

Additional Information

The same behavior (with the same error messages) occurs on two different Mattermost instances I maintain. They are completely independent, but are both using the same web hosting service (uberspace). Push notifications worked until a couple of weeks ago.

amyblais commented 1 day ago

Hi @errotu, do you reproduce this on our community server here https://community.mattermost.com/?

errotu commented 1 day ago

No, on the community server I receive the notifications without any problem. Maybe it's related to using either PostgreSQL (what the community server probably does) or MariaDB (what the both instances where the error occurs do)?

Just fyi: I had created the issue in the Mattermost server-repository because my guess was (based on the error message in the server's log) that the cause of the problem lies there, and is not directly related to the app's code.

ruhnet commented 10 hours ago

I have the same issue since upgrading to v10.2. I am running MariaDB 10.5 on Debian 11. I upgraded from MM 9.5 to 10.2 and push notifications stopped. In my notifications log I get the same thing as reported above.