[buddypress-trac] [BuddyPress Trac] #8426: Update queries when new message notifications mark as read
buddypress-trac
noreply at wordpress.org
Thu Sep 9 19:49:31 UTC 2021
#8426: Update queries when new message notifications mark as read
--------------------------+---------------------
Reporter: oztaser | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 10.0.0
Component: Messages | Version:
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+---------------------
Changes (by oztaser):
* keywords: has-patch reporter-feedback => has-patch
* milestone: Up Next => 10.0.0
Comment:
Hi @imath,
Sorry for my very late reply. Let's try to fix this in 10.0.0.
Your patch works fine. We avoid run update queries if there are no
notifications that need to be updated.
I've also thought about update queries for every thread message
notifications. In addition to your `where in` clause suggestion, what you
think about `less than or equal` condition? Can't we use update query like
below:
{{{
UPDATE `wp_bp_notifications` SET `is_new` = 0 WHERE `user_id` = 2 AND
`item_id` <= (MAX_UNREAD_ITEM_ID) AND `component_name` = 'messages' AND
`component_action` = 'new_message'
}}}
P.S: I've updated your patch because we've added `$user_id` parameter to
`messages_thread_mark_as_read` action.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8426#comment:9>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list