Read messages are not getting set to read

Bug #1535164 reported by Ghada El-Zoghbi on 2016-01-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Robert Lyon

Bug Description

Mahara: 15.10.1
DB: MySql
OS: Linux
Browser: Chrome and FF

Since the 15.10 upgrade, the 'read' message counter is not working properly.

It doesn't appear that the triggers are updating the usr.read field.

* I've tried with both multi recipient module on and off.

* I manually reset all usr.read = 0 in the DB (just to start with a clean slate)

* sent messages to a different user

* logged in as the other user and their counter hadn't increased.

I then went into the user's inbox and clicked on the message (i.e. to read it), the usr.read field never got updated. Neither did the module_multirecipient_userrelation.read get updated (or notification_internal_activity.read when mutil-recipient is off).

Using Chrome's developer tools, I can see that there is no network activity to the server to update the field as read:
* either when I click on the message
* or when I select 'Mark as read' from the bulk action with the message selected.

Changed in mahara:
status: New → Confirmed
importance: Undecided → High
Robert Lyon (robertl-9) wrote :

This looks to be working in postgres but not in mysql.

I wonder if it's due to the triggers having things like:

  UPDATE "usr" SET unread = unread + 1 WHERE id = NEW.usr

Where the table name is escaped in the postgres way, I wonder if it needs to be like

  UPDATE `usr` SET unread = unread + 1 WHERE id = NEW.usr

Which if true then there will be a bunch of triggers that need fixing up for MySql

Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
Robert Lyon (robertl-9) wrote :

Ah actually the triggers are working as expected (I just didn't switch notifications to inbox)

What the problem turns out to be is the inbox block on dashboard loads via ajax from 15.10 onwards so that the javascript meant to wire up the 'markasread' javascript functions are not connected.

Needed to fire off the 'pageupdated' trigger once the block had loaded so it could wire up the needed functions.

Changed in mahara:
status: Confirmed → In Progress
milestone: none → 17.04.0

Reviewed: https://reviews.mahara.org/7241
Committed: https://git.mahara.org/mahara/mahara/commit/c55a95581741d332089f6042cf8fbd879db3e2c4
Submitter: Ghada El-Zoghbi (<email address hidden>)
Branch: master

commit c55a95581741d332089f6042cf8fbd879db3e2c4
Author: Robert Lyon <email address hidden>
Date: Wed Nov 9 16:23:21 2016 +1300

Bug 1535164: Inbox needs to update unread messages

This bug came about due to the lazy load of the inbox block so that
the js hooks were not wired up correctly.

Added a pageupdated trigger to the block content and updated the
template so that we can update a row without needing the check box
(like we have in the inbox page itself)

behatnotneeded

Change-Id: I60de8301b2bb7ec5ef4ed33f1260cccdbdce36aa
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2017-01-05
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2017-04-27
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers