Homec4science

Notifications - fix race condition around "Mark All Read".

Authored by Bob Trahan <btrahan@phacility.com> on Aug 2 2014, 01:39.

Description

Notifications - fix race condition around "Mark All Read".

Summary:
pre-patch "Mark All Read" marks *all* unread notifications as read. This is a race condition in that the user is looking at some set of notiifcations and that set may update such that the newest notifications aren't shown. An example might be if sitting on the notifications page or having the menu open while a new notification comes in... Note re-opening the menu would show the latest notifications.

This patch makes it so "Mark All Read" links only marks the notifications currently loaded (and older.) Fixes T5764.

Additionally, if there is nothing to "mark read" the button / link "Mark All Read" will have a disabled style and yield a dialog saying "nothing to mark as read".

Test Plan: carefully tracked ?chronoKey populating correctly in various links. Verified query constructed properly too.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5764

Differential Revision: https://secure.phabricator.com/D10113

Details

Committed
Bob Trahan <btrahan@phacility.com>Aug 2 2014, 01:39
Pushed
aubortJan 31 2017, 17:16
Parents
rPHd18ba3f0045c: Fix tabs losing scroll position
Branches
Unknown
Tags
Unknown

Event Timeline

Bob Trahan <btrahan@phacility.com> committed rPHe50b26941643: Notifications - fix race condition around "Mark All Read". (authored by Bob Trahan <btrahan@phacility.com>).Aug 2 2014, 01:39