Page MenuHomePhabricator

Add a missing "GROUP BY" to MailQuery when querying for multiple recipients
ClosedPublic

Authored by epriestley on Oct 30 2020, 7:57 PM.
Tags
None
Referenced Files
F13184837: D21486.diff
Sat, May 11, 12:44 AM
F13179338: D21486.diff
Wed, May 8, 9:07 PM
Unknown Object (File)
Sat, May 4, 6:33 PM
Unknown Object (File)
Sat, Apr 27, 2:41 PM
Unknown Object (File)
Thu, Apr 25, 4:16 AM
Unknown Object (File)
Wed, Apr 24, 11:48 PM
Unknown Object (File)
Tue, Apr 23, 3:21 PM
Unknown Object (File)
Tue, Apr 23, 1:54 AM
Subscribers
None

Details

Summary

See https://discourse.phabricator-community.org/t/mail-details-view-broken/4315. The change in D21400 detects a missing "GROUP BY" in some variations of this query.

Specifically, we may join multiple recipient rows (since mail may have multiple recipients) and then fail to group the results.

Fix this by adding the "GROUP BY". Additionally, remove the special-cased behavior when no authors or recipients are specified -- it's complicated and not entirely correct (e.g., may produce a "no object" instead of a policy error when querying by ID), and likely predates overheating.

Test Plan
  • Disabled metamta.one-mail-per-recipient in Config.
  • Generated a message to 2+ recipients.
  • Viewed the message detail; queried for the message by specifying 2+ recipients.
  • Viewed the unfiltered list of messages, saw the query overheat.

Diff Detail

Repository
rP Phabricator
Branch
mail1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24953
Build 34428: Run Core Tests
Build 34427: arc lint + arc unit

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Oct 30 2020, 8:02 PM
This revision was automatically updated to reflect the committed changes.