Page MenuHomePhabricator

[keyserver] Replace raw SQL predicate to fetchThreadInfos with filter object
ClosedPublic

Authored by ashoat on Jul 16 2023, 4:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 29, 12:27 AM
Unknown Object (File)
Fri, Sep 27, 5:49 PM
Unknown Object (File)
Thu, Sep 26, 7:53 AM
Unknown Object (File)
Wed, Sep 25, 9:44 PM
Unknown Object (File)
Mon, Sep 23, 3:58 AM
Unknown Object (File)
Sun, Sep 22, 7:45 PM
Unknown Object (File)
Sun, Sep 22, 7:45 PM
Unknown Object (File)
Sun, Sep 22, 8:24 AM
Subscribers
None

Details

Summary

In future diffs, we're going to need to change how some filters are constructed based on the presence of other filters. In particular, if we are filtering for a particular user's visible threads, we'll want to apply further threadID filters as mm.thread IN rather than t.id IN.

To reduce the complexity of building these filters at the callsite, I'm replacing them with a filter object, and moving the responsibility of building the WHERE clause to fetchServerThreadInfos and fetchThreadInfos.

Depends on D8512

Test Plan

I made sure that I was able to load the website in my local dev environment, and that threads appeared to show up in chat

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

keyserver/src/scripts/add-thread-ancestry.js
30

I deleted this script rather than refactoring this callsite since I don't anticipate we'll need to use it again

keyserver/src/scripts/soft-launch-migration.js
54

I deleted this script rather than refactoring this callsite since I don't anticipate we'll need to use it again

This revision is now accepted and ready to land.Jul 17 2023, 4:07 AM