Page MenuHomePhabricator

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

Authored by btrahan on Aug 1 2014, 8:16 PM.
Tags
None
Referenced Files
F13090128: D10113.diff
Thu, Apr 25, 2:13 AM
F13080758: D10113.diff
Wed, Apr 24, 10:39 AM
Unknown Object (File)
Sat, Apr 6, 12:31 PM
Unknown Object (File)
Thu, Mar 28, 1:50 AM
Unknown Object (File)
Mar 13 2024, 8:23 PM
Unknown Object (File)
Feb 15 2024, 11:09 AM
Unknown Object (File)
Feb 15 2024, 11:09 AM
Unknown Object (File)
Feb 15 2024, 11:08 AM
Subscribers

Details

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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

btrahan retitled this revision from to Notifications - fix race condition around "Mark All Read"..
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
epriestley edited edge metadata.
epriestley added inline comments.
src/applications/notification/controller/PhabricatorNotificationClearController.php
16–17

Should this be <=, so the most recent one gets marked too?

src/applications/notification/controller/PhabricatorNotificationListController.php
64

I think we should still show the button, just disable it (for consistency with other UIs where possible-but-unavailable actions are greyed out).

src/applications/notification/controller/PhabricatorNotificationPanelController.php
31–32

And likewise herte.

This revision is now accepted and ready to land.Aug 1 2014, 8:29 PM

I think removing phabricator/src/.phutil_module_cache will fix that lint now, if you've update libphutil/.

ah, nice catch...! will update after lunch.

btrahan edited edge metadata.
  • <=
  • make buttons be disabled as opposed to not rendered
    • make a little dialog for the disabled case a la subscribers, etc
btrahan updated this revision to Diff 24322.

Closed by commit rPe50b26941643 (authored by @btrahan).