Homestyx hydra
Diffusion hydra 671986592baf

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

Description

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

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.

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

Details

Provenance
epriestleyAuthored on Oct 30 2020, 3:34 PM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:bc4f86d27996: When a new, deleted, draft inline is revived with "Undo", undelete it
Branches
Unknown
Tags
Unknown

Event Timeline