Page MenuHomePhabricator

Conpherence - finish basic application search
ClosedPublic

Authored by btrahan on Mar 31 2015, 11:35 PM.
Tags
None
Referenced Files
F14041644: D12232.id29384.diff
Mon, Nov 11, 8:13 PM
F13990363: D12232.id29384.diff
Tue, Oct 22, 3:02 AM
F13987989: D12232.id29429.diff
Mon, Oct 21, 12:29 PM
Unknown Object (File)
Oct 12 2024, 2:41 PM
Unknown Object (File)
Oct 9 2024, 8:32 PM
Unknown Object (File)
Sep 17 2024, 7:58 AM
Unknown Object (File)
Sep 12 2024, 6:55 AM
Unknown Object (File)
Sep 12 2024, 6:55 AM
Subscribers

Details

Summary

Fixes T7584. Adds the ability to specify rooms, messages, or both. Adds policy icon to rooms result view and envelope icon to messages result view. Fixes a missing group by clause in thread query. Enforces having participant phid if the query isn't looking at rooms and doesn't have other particpant phids.

This last bit has a small UI quirk if the user searches for "messages" or "both" with no participant phids as we don't give them the feedback that they were included in the query. We could just slap the viewer in the particpants list in this case but it seemed like a buggier feeling experience to have the viewer appear up there? (Especially so in messages case, where we are basically being smart about policy filtering to come.)

Test Plan

clicked around and got sensible results

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

btrahan retitled this revision from to Conpherence - finish basic application search.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added reviewers: epriestley, chad.
epriestley edited edge metadata.
epriestley added inline comments.
src/applications/conpherence/query/ConpherenceThreadQuery.php
83–88

This is sort of a lot of work, but can be done a little more cleanly / less awkwardly by adding a second join against the participant table (do this only if the viewer is logged in):

LEFT JOIN %T v ON v.conpherencePHID = conpherence_thread.phid
  AND v.participantPHID = %s

Then always adding another WHERE clause:

(isRoom = 1 OR v.participantPHID IS NOT NULL)

(If the viewer is not logged in, this could just be isRoom = 1, since logged-out users can never see threads.)

That should be more resistant to mistakes than the status quo, while still giving the correct behavior (searching for both rooms and threads won't return only rooms where you are a participant).

As written, this also probably (possibly?) has the wrong behavior for logged out users, although I don't know if they can even reach any of this stuff (but they'll probably be able to via dashboards eventually, at the very least?).

This might create a sort of sketchy query plan; an alternate approach is to build a rooms query (if rooms are included) and a threads query (if threads are included) with their respective isRoom = 1 and v.participantPHID IS NOT NULL clauses, then use UNION ALL to merge them. That's more complicated and very likely not necessary, though. (Differential does this in some cases.)

src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
6–8

This probably gets called before buildSavedQueryFromRequest() in at least some cases, I think. I'd maybe consider just returning Threads or Messages or something and dropping the isRooms property completely?

This revision is now accepted and ready to land.Mar 31 2015, 11:46 PM
btrahan edited edge metadata.

updates as requested

This revision was automatically updated to reflect the committed changes.