1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 12:41:19 +01:00
phorge-phorge/src/applications/notification
epriestley 0a3093ef9c Fix an issue where paginating notifications could fail a GROUP BY test
Summary:
Ref T13623. When paginating notifications, we may currently construct a query which:

  - loads from non-unique rows; and
  - returns multiple results.

In particular, `chronologicalKey` isn't unique across the whole table (only for a given viewer). We can get away with this because no user-facing view of notifications is truly "every notification for every viewer" today.

One fix would be to implicitly force the paging query to include `withUserPHIDs(viewerPHID)`, but puruse a slightly more general fix:

  - Load only unique stories.
  - Explictly limit the pagination subquery to one result.

Test Plan:
  - Set page size to 1, inserted duplicate notifications of all stories for another user, clicked "Next", got the GROUP BY error.
  - Applied the "only load unique stories" part of the change, got a "expected one row" error instead.
  - Applied the "limit 1" part of the change, got a second page of notifications.

Maniphest Tasks: T13623

Differential Revision: https://secure.phabricator.com/D21577
2021-02-26 15:11:25 -08:00
..
application Complete modernization of Aphlict configuration 2016-04-14 04:57:00 -07:00
builder Remove obsolete "NotifyTest" feed story 2018-12-10 16:03:42 -08:00
client Hide "notification.servers" configuration and don't follow redirects from Aphlict 2020-04-15 07:00:51 -07:00
config Fix additional "xprintf()"-class static parameter lint errors 2020-09-08 11:45:48 -07:00
controller Add "Move Left" and "Move Right" to dashboard tab panels 2019-05-01 15:35:53 -07:00
engineextension Fully modularize DestructionEngine 2015-12-21 17:03:44 -08:00
garbagecollector Provide bin/garbage for interacting with garbage collection 2015-10-02 09:17:24 -07:00
query Fix an issue where paginating notifications could fail a GROUP BY test 2021-02-26 15:11:25 -08:00
setup Give "Config" a full-width, hierarchical layout 2020-02-04 06:59:51 -08:00
storage Cache user notification and message counts 2016-06-05 08:52:43 -07:00
view Add an icon to aphlict connection status 2016-10-02 08:17:21 -07:00