Page MenuHomePhabricator

Notifications may fail to paginate with GROUP BY error
Closed, ResolvedPublic

Description

See https://discourse.phabricator-community.org/t/error-viewing-past-notifications/4498/.

When viewing a non-initial notifications page, we build a cursor with a query on chronologicalKey. This query may return more than one row, if that particular feed story notified more than one user. If it does, PhabricatorFeedStory::loadAllFromRows(...) fails with a GROUP BY error:

[Sat Jan 09 21:37:35.340510 2021] [:error] [pid 10222] [client 10.0.64.40:37057] [2021-01-09 21:37:35] EXCEPTION: (Exception) Rows passed to "loadAllFromArray(...)" include two or more rows with the same ID ("1204144"). Rows must have unique IDs. An underlying query may be missing a GROUP BY. at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:659]

In general, we should expect a NotificationQuery may load duplicate stories.

Related Objects

Event Timeline

epriestley created this task.

I deployed this and nothing blew up, presuming this is resolved.

See https://discourse.phabricator-community.org/t/error-viewing-notifications/4646.

An issue arose when a user loads a page of notifications which include stories they don't have permission to view.

I think this was resolved. I nuked Discourse anyway so it's effectively resolved until another report shows up.