gocast icon indicating copy to clipboard operation
gocast copied to clipboard

Target not correct for user notifications

Open carlobortolan opened this issue 1 year ago • 0 comments

Describe the bug When creating a "user notification" via the tumlive web-app, you should be able to define who the notification should be sent to (e.g., admin: target=5, lecturers: target=4, students target=3, loggedIn target=2, allUsers target=1). However, when doing so, internally it currently always sets the target to 1 targeting always all users.

To Reproduce Steps to reproduce the behavior:

  1. Go to the admin dashboard (localhost:8081/admin)
  2. Click on user notifications (localhost:8081/admin/notifications)
  3. Create a new user notification targeting "Loggedin users", "Students", "Lecturers" or "Admins" and when checking the records in the db, the target is always set to 1
  4. (See screenshots below)

Expected behavior When creating a "user notification" via the tumlive web-app, you should be able to define who the notification should be sent to (e.g., admin: target=5, lecturers: target=4, students target=3, loggedIn target=2, allUsers target=1).

Screenshots Create notification for "Admins" -> Target set to 1 instead of 5 Create notification for "Lecturers" -> Target set to 1 instead of 4. Create notification for "Students" -> Target set to 1 instead of 3. Create notification for "Loggedin users" -> Target set to 1 instead of 2.

image image image image image

Desktop:

  • OS: Manjaro Linux x86_64
  • Browser: Mozilla Firefox
  • Version: 121.0

Additional context

  • It may be that this issue occurs only locally and not on the deployed https://live.rbg.tum.de server, but an admin (/someone who can create notifications) would have to test this.

  • The issue appears to not be on the client's side as the client sends the correct target: image

  • The issue seems to be with the createNotification method, which doesn't bind the correct notification target resulting in the default target value (1) being used

carlobortolan avatar Jan 09 '24 00:01 carlobortolan